import { Link } from '@inertiajs/react'; import SectorEntry, { type SectorEntryData } from '@/components/sector-entry'; export type SectorDetailData = { sector: { id: number; name: string; slug: string; description: string | null; short_description: string | null; }; sectorEntry?: SectorEntryData | null; opportunities?: { title: string; slug: string; province: string | null; summary: string | null; }[]; }; const button = 'inline-block rounded-lg bg-emerald-800 px-5 py-3 font-semibold text-white disabled:opacity-50'; export default function SectorContent({ sector, sectorEntry, opportunities, headingLevel = 2, }: SectorDetailData & { headingLevel?: 2 | 3 }) { const Heading = headingLevel === 2 ? 'h2' : 'h3'; return (

{sector.description || sector.short_description || 'Descrição sectorial em preparação.'}

{!sectorEntry && ( Iniciar ou continuar uma ideia neste sector )} {sectorEntry && ( )} Oportunidades no sector {opportunities?.map((o) => (
{o.title}

{o.province}

{o.summary}

    {sectorEntry?.locations .filter( (l) => l.href === `/oportunidades/${o.slug}`, ) .filter( (l, i, rows) => rows.findIndex( (other) => JSON.stringify(other.location) === JSON.stringify(l.location), ) === i, ) .map((l, i) => (
  • {typeof l.location.name === 'string' ? l.location.name : 'Consultar localização e fonte na oportunidade'}
  • ))}
))} {!opportunities?.length && (

Sem oportunidades publicadas neste sector.

)} Pesquisar todas as oportunidades do sector

Preparar o investimento {' '} ·{' '} Pedir apoio sectorial

); }