import {
  Dialog,
  DialogContent,
  DialogHeader,
  DialogTitle,
} from "@/shared/common/ui/dialog";
import { EditDepartmentForm } from "../forms/EditDepartmentForm";
import { PositionDto } from "@/user-management/dto/positions/positionDto";

interface DepartmentDialogProps {
  isOpen: boolean;
  onClose: () => void;
  postions: PositionDto[];
  departmentId: string;
  departmentName: string;
}

export function EditDepartmentDialog({
  isOpen,
  onClose,
  postions,
  departmentId,
  departmentName,
}: DepartmentDialogProps) {
  const handleSuccess = (departmentName: string) => {
    onClose();
  };
  return (
    <Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
      <DialogContent className="sm:max-w-[425px]">
        <DialogHeader>
          <DialogTitle>Edit Department {departmentName}</DialogTitle>
        </DialogHeader>
        <EditDepartmentForm
          departmentId={departmentId}
          onSuccess={handleSuccess}
          onCancel={onClose}
        />
      </DialogContent>
    </Dialog>
  );
}
