import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; import type { AccessResponseDTO, CompanyDTO, WorkProfileDTO } from "../../common"; import { AccessForm } from "../access/access-form"; import { WorkProfileForm } from "../profiles/work-profile-form"; export function FolderQuickEditor({ kind, company, csrfToken, data, profile, onClose, onCreated, }: { kind: "profile" | "need"; company: CompanyDTO; csrfToken: string; data: AccessResponseDTO | undefined; profile: WorkProfileDTO | undefined; onClose: () => void; onCreated: (field: "profileId" | "needId", id: string) => void; }) { const { t } = useTranslation("companies"); return ( { if (!open) { onClose(); } }} open title={t(kind === "profile" ? "profiles.new" : "folders.newNeed")} wide > {kind === "profile" && ( onCreated("profileId", id)} /> )} {kind === "need" && data && profile && ( { if (id) { onCreated("needId", id); } }} people={company.people} scope={company.id} /> )} ); }