metis-desk/modules/assets/src/web/workstation-editor-dialog.tsx

45 lines
1.0 KiB
TypeScript
Raw Normal View History

2026-10-08 14:43:34 +00:00
import { FormDialog } from "@repo/shadcn-ui/components/form-dialog";
import type { ComponentProps } from "react";
import { useTranslation } from "react-i18next";
import { WorkstationForm } from "./workstation-form";
export function WorkstationEditorDialog({
workstation,
companyId,
csrfToken,
lookups,
onClose,
}: {
workstation: ComponentProps<typeof WorkstationForm>["workstation"];
companyId: string;
csrfToken: string;
lookups: ComponentProps<typeof WorkstationForm>["lookups"];
onClose: () => void;
}) {
const { t } = useTranslation("assets");
return (
<FormDialog
cancelLabel={t("cancel")}
formActions
onOpenChange={(open) => {
if (!open) {
onClose();
}
}}
open
title={t(workstation ? "editWorkstation" : "newWorkstation")}
wide
>
<WorkstationForm
companyId={companyId}
csrfToken={csrfToken}
lookups={lookups}
onSaved={() => onClose()}
workstation={workstation}
/>
</FormDialog>
);
}