fix: open individual sectors from catalogue cards without repeated detail
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-27 13:47:50 +02:00
parent 9fda6d6e12
commit 669cb8979b
7 changed files with 161 additions and 50 deletions
+1 -34
View File
@@ -71,7 +71,6 @@ type Page<T> = {
};
type Props = {
sectorEntry?: SectorDetailData['sectorEntry'];
sectorDetails?: SectorDetailData[];
countries?: Country[];
section: string;
filters?: Record<string, string | string[]>;
@@ -518,41 +517,9 @@ export default function Services(p: Props) {
description: sector.short_description,
opportunitiesCount: sector.opportunities_count,
specializations: sector.specializations,
url: p.sectorDetails?.length
? `#sector-${sector.slug}`
: sector.url,
url: sector.url,
}))}
/>
{p.sectorDetails?.map((detail) => (
<section
id={`sector-${detail.sector.slug}`}
key={detail.sector.id}
aria-labelledby={`sector-heading-${detail.sector.slug}`}
className="scroll-mt-24 space-y-5 border-t border-slate-200 pt-6"
>
<div className="flex flex-wrap items-center justify-between gap-3">
<h2
id={`sector-heading-${detail.sector.slug}`}
className="text-2xl font-bold"
>
{detail.sector.name}
</h2>
<Link
href={`/sectores/${detail.sector.slug}`}
className="inline-flex min-h-11 items-center text-sm font-semibold underline"
>
Abrir página do sector
</Link>
</div>
<SectorContent {...detail} headingLevel={3} />
<a
href="#sectores-indice"
className="inline-flex min-h-11 items-center text-sm font-semibold underline"
>
Voltar à lista de sectores
</a>
</section>
))}
{!p.sectors?.length && (
<p>Não existem sectores publicados.</p>
)}