import { Link, useForm } from '@inertiajs/react'; import { Management, Field, button, control } from '../management/shared'; import { titles, statuses, stages, roles } from './types'; import type { Structure, StructureRecord, Chain } from './types'; import ValueNetwork from './value-network'; import type { ChainLink, Gap } from './value-network'; function ChainForm({ clusterId, chain }: { clusterId: string; chain?: Chain }) { const form = useForm({ code: chain?.code ?? '', name: chain?.name ?? '', stage: chain?.stage ?? 'input', }); return (
); } export default function Editor({ structure, record, projects, chains, memberships, chainLinks, gaps, }: { structure: Structure; record: StructureRecord | null; projects: { id: string; name: string; code: string }[]; chains: Chain[]; chainLinks: ChainLink[]; gaps: Gap[]; memberships: { id: string; project_id: string; name: string; role: string; }[]; }) { const isProject = structure === 'projects'; const form = useForm({ code: record?.code ?? '', name: record?.name ?? '', status: record?.status ?? (isProject ? 'draft' : 'planned'), sector: record?.sector ?? '', description: record?.description ?? '', budget_amount: record?.budget_amount ?? '', budget_currency: record?.budget_currency ?? '', start_date: record?.start_date?.slice(0, 10) ?? '', end_date: record?.end_date?.slice(0, 10) ?? '', }); const association = useForm({ project_id: '', role: 'complementary' }); return (Registo interno de gestão. O estado activo não publica este conteúdo no portal.
{!isProject && record && ( <>{member.name} {' '} · {roles[member.role]}
))} {!memberships.length && (Ainda não existem projectos associados.
)}