34 lines
898 B
TypeScript
34 lines
898 B
TypeScript
import { FormDialog } from "@repo/rdx-ui/components/form-dialog";
|
|
import type { ComponentProps } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import { InterventionDetail } from "./intervention-detail";
|
|
|
|
export function InterventionDetailDialog({
|
|
currentView,
|
|
data,
|
|
onClose,
|
|
}: {
|
|
currentView: ComponentProps<typeof InterventionDetail>["intervention"] | undefined;
|
|
data: ComponentProps<typeof InterventionDetail>["data"] | undefined;
|
|
onClose: () => void;
|
|
}) {
|
|
const { t } = useTranslation("companies");
|
|
|
|
return (
|
|
<FormDialog
|
|
cancelLabel={t("cancel")}
|
|
onOpenChange={(value) => {
|
|
if (!value) {
|
|
onClose();
|
|
}
|
|
}}
|
|
open={Boolean(currentView)}
|
|
title={t("interventions.details")}
|
|
wide
|
|
>
|
|
{currentView && data && <InterventionDetail data={data} intervention={currentView} />}
|
|
</FormDialog>
|
|
);
|
|
}
|