import { Link, useForm, router } from "@inertiajs/react";
import InvestmentMapPanel from "@/components/investment-map-panel";
import { Management } from "../management/shared";
import { Layout, Field, control, button, labels, kind } from "./shared";
import type { Dossier } from "./shared";
export default function Show(props: Props) {
return ;
}
type Props = {
zones?: {
id: string;
name: string;
category: string;
association_type: string;
source_reference: string;
}[];
record: Dossier;
related: Dossier[];
management: boolean;
origin: { id: string; title: string } | null;
opportunities?: { id: number; title: string; slug: string; summary: string }[];
chains?: { id: string; name: string; stage: string }[];
};
function Editor({
record,
related,
management,
origin,
opportunities = [],
chains = [],
zones = [],
}: Props) {
const form = useForm({
title: record.title,
source: record.source,
content: record.content,
version_no: record.version_no,
});
const approval = useForm({ approval_evidence: "", version_no: record.version_no });
const save = useForm({ origin_id: origin?.id ?? null });
const Frame = management ? Management : Layout;
const base = management ? "/management/portfolio" : "/carteira";
return (
{kind(record)} · {record.content.code}
Fonte: {record.source}
{!management && (record.cluster_id || record.corridor_id || record.project_id) && (
)}
{zones.length > 0 && (
ZEE, ZFI e parques relacionados
{zones.map((z) => (
{z.name}
{" "}
· {z.association_type} · Fonte: {z.source_reference}
))}
)}
{origin && Exploração iniciada em: {origin.title}
}
{!management && (
)}
{chains.length > 0 && (
Cadeia de valor
{chains.map((chain) => (
{chain.name} —{" "}
{(
{
input: "Insumos",
production: "Produção",
processing: "Transformação",
logistics: "Logística",
market: "Mercado",
} as Record
)[chain.stage] ?? chain.stage}
))}
)}
Oportunidades relacionadas
{opportunities.map((opportunity) => (
{opportunity.title}
{opportunity.summary}
))}
{!opportunities.length && (
Sem oportunidades publicadas associadas a esta ficha.
)}
{management ? (
<>
Versão editorial: {record.version_no}. Guarde as alterações antes de
publicar.
>
) : (
<>
{Object.entries(record.content)
.filter(([k]) => k !== "name" && k !== "code")
.map(([key, value]) => (
- {labels[key] ?? key}
- {value}
))}
>
)}
Percurso de execução
- Explore as relações entre corredor, cluster e projecto âncora.
-
Consulte as componentes, parceiros e oportunidades de participação da ficha.
-
Guarde a ficha no painel do investidor e manifeste interesse com o papel e
prazo pretendidos.
- A equipa acompanha o pedido no CRM, com responsável e próxima acção.
{management && (
{record.project_id && (
Gerir projecto
)}
{record.cluster_id && (
Gerir cadeias e lacunas do cluster
)}
Acompanhar pedidos
{record.publication_status === "published" && (
Abrir ficha pública
)}
)}
Relações na carteira
{related.map((r) => (
{kind(r)}:{" "}
{r.title}
))}
{!related.length && Sem relações disponíveis para consulta.
}
);
}