37 lines
915 B
TypeScript
37 lines
915 B
TypeScript
import { FormDialog } from "@repo/rdx-ui/components/form-dialog";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import { PersonForm } from "../../../people";
|
|
import { ProcessTemplateForm } from "../../../process-templates";
|
|
|
|
export function ProcessQuickCreateDialog({
|
|
quick,
|
|
companyId,
|
|
onCreated,
|
|
onOpenChange,
|
|
}: {
|
|
quick: "person" | "template";
|
|
companyId: string;
|
|
onCreated: (id: string) => void;
|
|
onOpenChange: (open: boolean) => void;
|
|
}) {
|
|
const { t } = useTranslation("companies");
|
|
|
|
return (
|
|
<FormDialog
|
|
cancelLabel={t("cancel")}
|
|
formActions
|
|
onOpenChange={onOpenChange}
|
|
open
|
|
title={t(quick === "person" ? "newPerson" : "processes.newTemplate")}
|
|
wide
|
|
>
|
|
{quick === "person" ? (
|
|
<PersonForm companyId={companyId} onSaved={onCreated} />
|
|
) : (
|
|
<ProcessTemplateForm onSaved={onCreated} />
|
|
)}
|
|
</FormDialog>
|
|
);
|
|
}
|