import { Link, useForm } from "@inertiajs/react"; import { useState } from "react"; import { Frame, Field, Errors, control, button, type Partnership, type Catalogues, } from "./shared"; type Location = { geo_location_id: string; role: string; source_reference: string; }; type Origin = { type: string; target_id: string }; type Props = Catalogues & { record: Partnership | null; locations: Location[]; origins: Origin[]; }; function Editor(p: Props) { const form = useForm({ client_key: crypto.randomUUID(), version: p.record?.version ?? null, title: p.record?.title ?? "", offer: p.record?.offer ?? "", seeking: p.record?.seeking ?? "", organization_id: p.record?.organization_id ?? "", sector_id: p.record?.sector_id?.toString() ?? "", kind: p.record?.kind ?? "seeking", partnership_type: p.record?.partnership_type ?? "", deadline: p.record?.deadline ?? "", payload: { summary: p.record?.payload.summary ?? "", requirements: p.record?.payload.requirements ?? "", mandatory: p.record?.payload.mandatory ?? ([] as string[]), confidentiality: p.record?.payload.confidentiality ?? "public", consent: p.record?.payload.consent ?? false, }, locations: p.locations.map((x) => ({ geo_location_id: x.geo_location_id, role: x.role, source_reference: x.source_reference, })), origins: p.origins.map((x) => ({ type: x.type, target_id: x.target_id, })), }); const [place, setPlace] = useState(""); const [role, setRole] = useState("primary"); const [source, setSource] = useState("Declaração do proponente"); const [origin, setOrigin] = useState(""); return (

Guarde uma ideia e retome-a no seu painel. Empresa constituída, NUIT, documentos e verificação não são exigidos para preparar o rascunho. As informações desconhecidas ficam pendentes.

{ e.preventDefault(); if (p.record) form.put("/parcerias/" + p.record.id); else form.post("/parcerias/rascunhos"); }} > form.setData("title", e.target.value)} />