45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
TypeScript
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>
|
|
);
|
|
}
|