mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 07:38:10 +00:00
40 lines
921 B
TypeScript
40 lines
921 B
TypeScript
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from "@/shared/common/ui/dialog";
|
|
import { t } from "i18next";
|
|
import { AddUnitForm } from "../forms/AddUnitForm";
|
|
|
|
interface UnitDialogProps {
|
|
isOpen: boolean;
|
|
onClose: () => void;
|
|
organizationId: string;
|
|
}
|
|
|
|
export function AddUnitDialog({
|
|
isOpen,
|
|
onClose,
|
|
organizationId,
|
|
}: UnitDialogProps) {
|
|
const handleSuccess = (unitName: string) => {
|
|
onClose();
|
|
};
|
|
|
|
return (
|
|
<Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
|
|
<DialogContent className="sm:max-w-[425px]">
|
|
<DialogHeader>
|
|
<DialogTitle>{t("contentManagement.addNewUnit")}</DialogTitle>
|
|
</DialogHeader>
|
|
<AddUnitForm
|
|
organizationId={organizationId}
|
|
onSuccess={handleSuccess}
|
|
onCancel={onClose}
|
|
/>
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
}
|