51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
|
|
import { Sites } from "@/_config/sites";
|
|
import { api_units_byId } from "@/actions/rk2/api-units";
|
|
|
|
import { api_anlage_getSelected } from "@/actions/rk/api-anlage";
|
|
import { UnitCreateForm } from "@/components/rk2/units/unit_createForm";
|
|
|
|
import Link from "next/link";
|
|
import { UnitEdit } from "@/components/rk2/units/unitEdit";
|
|
import { api_groups, api_groups_byId } from "@/actions/rk2/api-groups";
|
|
import { componentDefaults, componentTypeDefinitions } from "@/actions/rk2/api-compTypes";
|
|
|
|
import Breadcrumbs from "@/components/ui/navigation/breadcrumbs";
|
|
import { GroupForm } from "@/components/rk2/groups/groupForm";
|
|
import { GroupEdit } from "@/components/rk2/groups/groupEdit";
|
|
|
|
type Props = {
|
|
params: Promise<{
|
|
id: string;
|
|
}>;
|
|
};
|
|
|
|
|
|
|
|
export default async function PageGroupEdit({ params }: Props) {
|
|
|
|
const { id } = await params;
|
|
const resultFindGroupById = await api_groups_byId(id);
|
|
const anlage = await api_anlage_getSelected();
|
|
const group = resultFindGroupById.data;
|
|
const groups = await api_groups();
|
|
|
|
const breadcrumb = [{ label: "RK", href: "/" },{ label: "Anlage", href: "/rk2" },{ label: "Groups", href: "/rk2/groups" }, { label: "Edit" }, { label: group.name }]
|
|
|
|
if (!resultFindGroupById.success) return <div>Grouppe nicht gefunden {resultFindGroupById.errors} {id}</div>
|
|
|
|
return (
|
|
<div className="">
|
|
<div>
|
|
<Breadcrumbs items={breadcrumb}/>
|
|
</div>
|
|
|
|
<div className="flex flex-col m-4 w-300 ">
|
|
|
|
<GroupEdit anlage={anlage} selectedGroup={group} groups={groups} />
|
|
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|