@@ -60,7 +66,7 @@ export default function EditStaff() {
return (
{staff && (
-
+
+ {!isEditing && (
+
+
+
+ )}
+ {isEditing && (
+
+
+
+
+ )}
+
+
)}
);
diff --git a/apps/web/src/features/workforce/directory/components/StaffForm.tsx b/apps/web/src/features/workforce/directory/components/StaffForm.tsx
index cbe2cfb7..dbc5095f 100644
--- a/apps/web/src/features/workforce/directory/components/StaffForm.tsx
+++ b/apps/web/src/features/workforce/directory/components/StaffForm.tsx
@@ -7,9 +7,9 @@ import { Button } from "@/common/components/ui/button";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/common/components/ui/select";
import { Checkbox } from "@/common/components/ui/checkbox";
import {
- Save, Loader2, User, Activity, MapPin,
- Calendar, ChevronRight, FileText,
- Shield, Star, Info
+ Save, Loader2, User, FileText, Briefcase,
+ Calendar, ChevronRight, Shield, Star, Info,
+ Mail, Phone, MapPin, Award, Clock, AlertCircle
} from "lucide-react";
import { AnimatePresence } from "framer-motion";
import type { Staff } from "../../type";
@@ -19,12 +19,13 @@ interface StaffFormProps {
staff?: Staff;
onSubmit: (data: Omit
) => Promise;
isSubmitting: boolean;
+ disabled?: boolean;
}
-type TabType = "general" | "performance" | "location" | "additional";
+type TabType = "overview" | "documents" | "work_history" | "compliance";
-export default function StaffForm({ staff, onSubmit, isSubmitting }: StaffFormProps) {
- const [activeTab, setActiveTab] = useState("general");
+export default function StaffForm({ staff, onSubmit, isSubmitting, disabled = false }: StaffFormProps) {
+ const [activeTab, setActiveTab] = useState("overview");
const { register, handleSubmit, control, reset } = useForm({
defaultValues: staff || {
@@ -55,7 +56,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }: StaffFormPr
action: "",
notes: "",
accounting_comments: "",
- rating: 0,
+ averageRating: 0,
shift_coverage_percentage: 100,
cancellation_count: 0,
no_show_count: 0,
@@ -75,10 +76,10 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }: StaffFormPr
};
const tabs: { id: TabType; label: string; icon: React.ReactNode }[] = [
- { id: "general", label: "General Info", icon: },
- { id: "performance", label: "Performance", icon: },
- { id: "location", label: "Location", icon: },
- { id: "additional", label: "Other", icon: },
+ { id: "overview", label: "Overview", icon: },
+ { id: "documents", label: "Documents", icon: },
+ { id: "work_history", label: "Work History", icon: },
+ { id: "compliance", label: "Compliance", icon: },
];
return (
@@ -104,7 +105,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }: StaffFormPr