28 lines
961 B
TypeScript
28 lines
961 B
TypeScript
import { redirect } from 'next/navigation';
|
|
import { api_groups } from '@/actions/rk2/api-groups';
|
|
import { api_anlage_getSelected } from '@/actions/rk/api-anlage';
|
|
import { api_groupOverview } from '@/actions/rk2/api-group-overview';
|
|
import Breadcrumbs from '@/components/ui/navigation/breadcrumbs';
|
|
import GroupOverview from '@/components/rk2/groups/groupOverview';
|
|
|
|
export default async function GroupsPage() {
|
|
const anlage = await api_anlage_getSelected();
|
|
if (!anlage?.id) {
|
|
redirect('/projekte');
|
|
}
|
|
|
|
const groups = await api_groups();
|
|
const { sections, warnings } = await api_groupOverview(groups, anlage.id);
|
|
const breadcrumb = [
|
|
{ label: 'Anlage', href: '/' },
|
|
{ label: 'Gruppen' },
|
|
];
|
|
|
|
return (
|
|
<div className="min-w-0 space-y-4">
|
|
<Breadcrumbs items={breadcrumb} />
|
|
<GroupOverview groups={groups} sections={sections} warnings={warnings} />
|
|
</div>
|
|
);
|
|
}
|