19 lines
906 B
TypeScript
19 lines
906 B
TypeScript
import Link from 'next/link';
|
||
import { api_viewAggregate } from '@/actions/rk2/api-procon-view-aggregate';
|
||
import ViewAggregateForm from '@/components/rk2/visu-aggregate/viewAggregateForm';
|
||
|
||
export default async function Page({ params }: { params: Promise<{ componentId: string }> }) {
|
||
const { componentId } = await params;
|
||
try {
|
||
const data = await api_viewAggregate(componentId);
|
||
return <div><Link href="/rk2/visu-aggregate" className="underline">Zurück zu VisuAggregate</Link>
|
||
<h1 className="my-4 text-xl font-semibold">Grafiken – {data.name}</h1>
|
||
<ViewAggregateForm componentId={componentId} initial={data} />
|
||
</div>;
|
||
} catch (error) {
|
||
return <div><Link href="/rk2/visu-aggregate" className="underline">Zurück zur Tabelle</Link>
|
||
<p role="alert" className="mt-4 text-red-600">{error instanceof Error ? error.message : 'Laden fehlgeschlagen'}</p></div>;
|
||
}
|
||
}
|
||
|