feat: preserve grounded sector ideas through private investment dossiers in QA
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import type { SectorAnalysis } from './sector-content-analysis';
|
||||
import { Link } from '@inertiajs/react';
|
||||
|
||||
export type EducationalArticle = {
|
||||
sector_analysis?: SectorAnalysis;
|
||||
title: string;
|
||||
href: string;
|
||||
summary: string;
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
|
||||
export type SectorIdea = {
|
||||
title: string;
|
||||
start_href: string;
|
||||
location_label: string | null;
|
||||
evidence: { key: string; quote: string; section: string };
|
||||
};
|
||||
export type SectorAnalysis = {
|
||||
ideas: SectorIdea[];
|
||||
region?: string | null;
|
||||
notice: string;
|
||||
source_date: string;
|
||||
};
|
||||
|
||||
/** The same evidence-to-preparation controls on sector and regional articles. */
|
||||
export default function SectorContentAnalysis({
|
||||
data,
|
||||
}: {
|
||||
data: SectorAnalysis;
|
||||
}) {
|
||||
const [selected, setSelected] = useState(0);
|
||||
const idea = data.ideas[selected];
|
||||
if (!idea) return null;
|
||||
return (
|
||||
<section
|
||||
className="space-y-4 rounded-xl border bg-white p-4"
|
||||
aria-label="Ideias fundamentadas neste contexto"
|
||||
>
|
||||
<h2 className="text-xl font-semibold">Do contexto à sua ideia</h2>
|
||||
<p>{data.notice}</p>
|
||||
<label className="grid gap-1">
|
||||
Possibilidade a explorar
|
||||
<select
|
||||
className="min-w-0 rounded border p-3"
|
||||
value={selected}
|
||||
onChange={(e) => setSelected(Number(e.target.value))}
|
||||
>
|
||||
{data.ideas.map((item, index) => (
|
||||
<option key={item.title} value={index}>
|
||||
{item.title}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<p>
|
||||
<strong>Hipótese de negócio:</strong> {idea.title}
|
||||
</p>
|
||||
<p>
|
||||
{idea.location_label
|
||||
? `Contexto provincial: ${idea.location_label}. O distrito e a implantação serão escolhidos por si.`
|
||||
: 'A localização do investimento fica por escolher. Não é necessário pertencer a uma zona demarcada.'}
|
||||
</p>
|
||||
<details className="rounded border p-3">
|
||||
<summary>Fundamento e origem</summary>
|
||||
{idea.evidence.section && <p>{idea.evidence.section}</p>}
|
||||
<blockquote className="my-3 border-l-2 pl-3">
|
||||
{idea.evidence.quote}
|
||||
</blockquote>
|
||||
<p>
|
||||
Edição consultada: {data.source_date}. Afirmação atribuída à
|
||||
fonte; não constitui previsão do seu negócio.
|
||||
</p>
|
||||
</details>
|
||||
<ol className="list-decimal space-y-2 pl-5">
|
||||
<li>Escolha ou confirme a localização conhecida.</li>
|
||||
<li>
|
||||
Compare actividades similares e complementares; confira a
|
||||
cobertura dos registos.
|
||||
</li>
|
||||
<li>Prepare custos, receitas e cenários no mesmo dossier.</li>
|
||||
</ol>
|
||||
<nav
|
||||
className="flex flex-wrap gap-3"
|
||||
aria-label="Continuar esta ideia"
|
||||
>
|
||||
<Link
|
||||
className="rounded bg-emerald-800 p-3 text-white"
|
||||
href={idea.start_href}
|
||||
>
|
||||
Preparar investimento a partir deste contexto
|
||||
</Link>
|
||||
<Link
|
||||
className="rounded border p-3"
|
||||
href={`${idea.start_href}&analysis_action=compare`}
|
||||
>
|
||||
Comparar com a oferta existente
|
||||
</Link>
|
||||
</nav>
|
||||
<p className="text-sm">
|
||||
A comparação é feita no dossier privado, com os acessos
|
||||
autorizados. Zero anúncios ou registos não prova ausência de
|
||||
empresas, concorrência ou potencial.
|
||||
</p>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
import SectorResourceReference, { type SectorResourceData } from './sector-resource-reference';
|
||||
import SectorContentAnalysis from './sector-content-analysis';
|
||||
import SectorResourceReference, {
|
||||
type SectorResourceData,
|
||||
} from './sector-resource-reference';
|
||||
import { Link } from '@inertiajs/react';
|
||||
import EducationalArticleCard, {
|
||||
type EducationalArticle,
|
||||
@@ -45,7 +48,18 @@ export default function SectorEntry({
|
||||
modalidade adequada. Cada oportunidade tem promotor, objetivo e
|
||||
dados próprios.
|
||||
</p>
|
||||
{data.resource_reference && <SectorResourceReference data={data.resource_reference} />}
|
||||
{data.resource_reference && (
|
||||
<SectorResourceReference data={data.resource_reference} />
|
||||
)}
|
||||
{data.articles.map(
|
||||
(article) =>
|
||||
article.sector_analysis && (
|
||||
<SectorContentAnalysis
|
||||
key={article.href}
|
||||
data={article.sector_analysis}
|
||||
/>
|
||||
),
|
||||
)}
|
||||
<nav aria-label="Ações no setor" className="flex flex-wrap gap-3">
|
||||
{data.start_href ? (
|
||||
<Link
|
||||
|
||||
Reference in New Issue
Block a user