33 lines
844 B
TypeScript
33 lines
844 B
TypeScript
import { FormDialog } from "@repo/rdx-ui/components/form-dialog";
|
|
import type { ComponentProps } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import { TicketQuickEditor } from "./ticket-quick-editor";
|
|
|
|
export function TicketTargetCreateDialog({
|
|
quick,
|
|
companyId,
|
|
onSaved,
|
|
onOpenChange,
|
|
}: {
|
|
quick: ComponentProps<typeof TicketQuickEditor>["kind"] | undefined;
|
|
companyId: string;
|
|
onSaved: (id: string) => void;
|
|
onOpenChange: (open: boolean) => void;
|
|
}) {
|
|
const { t } = useTranslation("companies");
|
|
|
|
return (
|
|
<FormDialog
|
|
cancelLabel={t("cancel")}
|
|
formActions
|
|
onOpenChange={onOpenChange}
|
|
open={Boolean(quick)}
|
|
title={t("tickets.newTarget")}
|
|
wide
|
|
>
|
|
{quick && <TicketQuickEditor companyId={companyId} kind={quick} onSaved={onSaved} />}
|
|
</FormDialog>
|
|
);
|
|
}
|