Integrate mining and energy references into sector and dossier journeys
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type { SectorResourceSelection } from '@/components/sector-resource-reference';
|
||||
import { createOperationKey } from '@/lib/operation-key';
|
||||
import { Head, Link, router, useForm } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
@@ -19,11 +20,13 @@ export default function InvestmentContexts({
|
||||
contexts,
|
||||
contentSource,
|
||||
sectorSource,
|
||||
resourceSource,
|
||||
zoneSource,
|
||||
companyComparisonAnswers,
|
||||
guideSelection,
|
||||
}: {
|
||||
contexts: InvestmentContext[];
|
||||
resourceSource?: SectorResourceSelection;
|
||||
companyComparisonAnswers?: CompanyAnswers | null;
|
||||
guideSelection?: GuideSelection | null;
|
||||
contentSource?: LegacyArticle;
|
||||
@@ -46,6 +49,14 @@ export default function InvestmentContexts({
|
||||
reuse_consent: false,
|
||||
content_resource_id: contentSource?.id,
|
||||
sector_slug: sectorSource?.slug,
|
||||
sector_reference: resourceSource
|
||||
? {
|
||||
area_id: resourceSource.area_id,
|
||||
group_id: resourceSource.group_id,
|
||||
source_sha256: resourceSource.source_sha256,
|
||||
location_label: resourceSource.location_label,
|
||||
}
|
||||
: undefined,
|
||||
...(companyComparisonAnswers
|
||||
? { company_comparison: companyComparisonAnswers }
|
||||
: {}),
|
||||
@@ -87,6 +98,14 @@ export default function InvestmentContexts({
|
||||
publicada.
|
||||
</p>
|
||||
)}
|
||||
{resourceSource && (
|
||||
<section className="rounded border p-4">
|
||||
<h2>{resourceSource.title}</h2>
|
||||
<p>{resourceSource.location_label ?? resourceSource.locations_text}</p>
|
||||
<p>{resourceSource.value_chain}</p>
|
||||
<p>Esta referência será guardada apenas no dossier que escolher.</p>
|
||||
</section>
|
||||
)}
|
||||
{contentSource && (
|
||||
<p>
|
||||
Preparar a partir de{' '}
|
||||
@@ -155,6 +174,7 @@ export default function InvestmentContexts({
|
||||
{
|
||||
version: item.version,
|
||||
sector_slug: sectorSource.slug,
|
||||
...(resourceSource ? { sector_reference: form.data.sector_reference } : {}),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { SectorResourceSelection } from '@/components/sector-resource-reference';
|
||||
import {
|
||||
financialCategories,
|
||||
financialTypes,
|
||||
@@ -44,6 +45,7 @@ type Step = {
|
||||
source_paragraph: number;
|
||||
};
|
||||
type Path = {
|
||||
sector_references?: SectorResourceSelection[];
|
||||
funding_selections?: {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -639,6 +641,21 @@ export default function InvestmentPath(path: Path) {
|
||||
)}
|
||||
</label>
|
||||
)}
|
||||
{!!path.sector_references?.length && (
|
||||
<section className="space-y-3 rounded border p-4">
|
||||
<h2 className="text-lg font-semibold">Sectores e cadeias de valor</h2>
|
||||
{path.sector_references.map((reference) => (
|
||||
<article key={reference.key}>
|
||||
<h3>{reference.title}</h3>
|
||||
<p>{reference.location_label ?? reference.locations_text}</p>
|
||||
<p>{reference.value_chain}</p>
|
||||
<Link className="underline" href={reference.href}>
|
||||
Consultar a referência mineral
|
||||
</Link>
|
||||
</article>
|
||||
))}
|
||||
</section>
|
||||
)}
|
||||
<ContextDocuments
|
||||
source={path.investment_context?.selection.opportunity}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user