continued the kita-planer

This commit is contained in:
t.indorf
2026-05-08 14:32:14 +02:00
parent b686e714ff
commit 7aff691803
85 changed files with 9434 additions and 588 deletions
+22 -6
View File
@@ -2,7 +2,6 @@
import { useState, useTransition } from "react";
import { Plus, X, Shield, Trash2 } from "lucide-react";
import { ParentDuty, ParentDutyAssignment, User } from "@prisma/client";
import { toast } from "sonner";
import { Button } from "@/components/ui/button";
@@ -15,13 +14,30 @@ import {
DialogTrigger,
} from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Badge } from "@/components/ui/badge";
import { createDuty, assignDuty, removeDutyAssignment, deleteDuty } from "./duty-actions";
type DutyWithAssignments = ParentDuty & {
assignments: ParentDutyAssignment[];
type DutyWithAssignments = {
id: string;
name: string;
assignments: {
id: string;
}[];
};
type DutyUser = {
id: string;
firstName: string;
lastName: string;
};
type UserDutyAssignment = {
id: string;
dutyId: string;
duty: {
name: string;
};
};
export function DutyManager({
@@ -29,9 +45,9 @@ export function DutyManager({
allDuties,
userAssignments,
}: {
user: User;
user: DutyUser;
allDuties: DutyWithAssignments[];
userAssignments: (ParentDutyAssignment & { duty: ParentDuty })[];
userAssignments: UserDutyAssignment[];
}) {
const [open, setOpen] = useState(false);
const [isPending, startTransition] = useTransition();