37 lines
889 B
TypeScript
37 lines
889 B
TypeScript
import { FormDialog } from "@repo/rdx-ui/components/form-dialog";
|
|
import type { ComponentProps } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import type { CompanyDTO } from "../../../../common";
|
|
|
|
import { ProcessStartForm } from "./process-start-form";
|
|
|
|
export function ProcessStartDialog({
|
|
open,
|
|
company,
|
|
csrfToken,
|
|
onSaved,
|
|
onOpenChange,
|
|
}: {
|
|
open: boolean;
|
|
company: CompanyDTO;
|
|
csrfToken: string;
|
|
onSaved: ComponentProps<typeof ProcessStartForm>["onSaved"];
|
|
onOpenChange: (open: boolean) => void;
|
|
}) {
|
|
const { t } = useTranslation("companies");
|
|
|
|
return (
|
|
<FormDialog
|
|
cancelLabel={t("cancel")}
|
|
formActions
|
|
onOpenChange={onOpenChange}
|
|
open={open}
|
|
title={t("processes.new")}
|
|
wide
|
|
>
|
|
{open && <ProcessStartForm company={company} csrfToken={csrfToken} onSaved={onSaved} />}
|
|
</FormDialog>
|
|
);
|
|
}
|