Files
Investidor-V2/resources/js/pages/portfolio/shared.tsx
T
nala 250ac35fd1
tests / ci (push) Canceled after 0s
first commit
2026-09-28 10:01:09 +02:00

56 lines
2.1 KiB
TypeScript

import { Head, Link, usePage } from "@inertiajs/react";
import type { ReactNode } from "react";
export { button, control, Field, Pagination } from "../management/shared";
export type Dossier = {
id: string;
title: string;
source: string;
content: Record<string, string>;
project_id: string | null;
cluster_id: string | null;
corridor_id: string | null;
publication_status: string;
version_no?: number;
};
export const labels: Record<string, string> = {
description: "Visão e proposta de valor",
location: "Território",
region: "Região",
sector: "Sector",
promotion: "Promoção",
facts: "Dados indicativos da fonte",
partners: "Investidores e parceiros",
cta: "Próxima acção",
anchors: "Projectos âncora e oportunidades",
gaps: "Lacunas da cadeia de valor",
priority: "Prioridade proposta na matriz",
clusters: "Clusters associados",
focus: "Investimentos complementares",
notice: "Estado de validação",
code: "Código",
};
export const kind = (r: Pick<Dossier, "project_id" | "cluster_id" | "corridor_id">) =>
r.corridor_id ? "Corredor" : r.cluster_id ? "Cluster" : "Projecto âncora";
export function Layout({ title, children }: { title: string; children: ReactNode }) {
const { flash } = usePage<{ flash?: { success?: string } }>().props;
return (
<main className="mx-auto max-w-6xl space-y-6 p-4 md:p-8">
<Head title={title} />
<nav className="flex flex-wrap gap-5 text-sm underline" aria-label="Investimento">
<Link href="/">InvestMoz</Link>
<Link href="/carteira?kind=corridor">Corredores</Link>
<Link href="/carteira?kind=cluster">Clusters</Link>
<Link href="/carteira?kind=project">Projectos âncora</Link>
<Link href="/investidor">O meu painel</Link>
</nav>
<h1 className="text-3xl font-semibold">{title}</h1>
{flash?.success && (
<p role="status" className="rounded border p-3">
{flash.success}
</p>
)}
{children}
</main>
);
}