"use client" import { useAuthApi } from "@/shared/useApi" import { useRouter } from "next/navigation" import { Button } from "@/shared/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/shared/components/ui/dropdown-menu" import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/shared/components/ui/dialog" import { ScrollArea } from "@/shared/components/ui/scroll-area" import { Ellipsis, Pencil, Trash2 } from "lucide-react" import { useFormDialog } from "@/shared/components/form-dialog" import { EmployeeForm } from "./employee-form" type EmployeeActionsProps = { employeeId: string } export function EmployeeActions({ employeeId }: EmployeeActionsProps) { const api = useAuthApi() const router = useRouter() const editDialog = useFormDialog("employee_edit") const handleDelete = async () => { await api.employees.destroy(employeeId) router.push("/productivity/employees") } return ( <> editDialog.open(employeeId)}> Edit Delete { if (!v) editDialog.close() }}> Edit Employee { editDialog.close() router.refresh() }} /> ) }