@@ -13,9 +13,11 @@ export type InvestmentContext = {
|
||||
export default function InvestmentContexts({
|
||||
contexts,
|
||||
contentSource,
|
||||
sectorSource,
|
||||
}: {
|
||||
contexts: InvestmentContext[];
|
||||
contentSource?: LegacyArticle;
|
||||
sectorSource?: { id: number; name: string; slug: string; href: string };
|
||||
}) {
|
||||
const [key] = useState(() => createOperationKey());
|
||||
const form = useForm({
|
||||
@@ -23,11 +25,22 @@ export default function InvestmentContexts({
|
||||
client_key: key,
|
||||
reuse_consent: false,
|
||||
content_resource_id: contentSource?.id,
|
||||
sector_slug: sectorSource?.slug,
|
||||
});
|
||||
return (
|
||||
<main className="mx-auto max-w-5xl space-y-6 p-4 md:p-8">
|
||||
<Head title="Os meus investimentos" />
|
||||
<h1 className="text-2xl font-semibold">Os meus investimentos</h1>
|
||||
{sectorSource && (
|
||||
<p>
|
||||
Preparar uma ideia em{' '}
|
||||
<Link className="underline" href={sectorSource.href}>
|
||||
{sectorSource.name}
|
||||
</Link>
|
||||
. O setor será recuperado no dossier, mesmo sem oportunidade
|
||||
publicada.
|
||||
</p>
|
||||
)}
|
||||
{contentSource && (
|
||||
<p>
|
||||
Preparar a partir de{' '}
|
||||
@@ -54,6 +67,23 @@ export default function InvestmentContexts({
|
||||
Guardado em{' '}
|
||||
{new Date(item.updated_at).toLocaleString('pt-MZ')}
|
||||
</p>
|
||||
{sectorSource && (
|
||||
<button
|
||||
type="button"
|
||||
className="mt-3 rounded border p-2"
|
||||
onClick={() =>
|
||||
router.post(
|
||||
`/investimentos/${item.id}/sectores`,
|
||||
{
|
||||
version: item.version,
|
||||
sector_slug: sectorSource.slug,
|
||||
},
|
||||
)
|
||||
}
|
||||
>
|
||||
Continuar neste dossier com o setor
|
||||
</button>
|
||||
)}
|
||||
{contentSource && (
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import FintechInvestment, {
|
||||
type FintechView,
|
||||
} from '@/components/fintech-investment';
|
||||
import { createOperationKey } from '@/lib/operation-key';
|
||||
import { Head, Link, router, useForm, usePage } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
@@ -21,6 +24,8 @@ type Step = {
|
||||
source_paragraph: number;
|
||||
};
|
||||
type Path = {
|
||||
fintech: FintechView | null;
|
||||
sector_contexts: { id: number; name: string; slug: string; href: string }[];
|
||||
case: { id: string; title: string; version: number; closed: boolean };
|
||||
phases: Record<string, string>;
|
||||
steps: Step[];
|
||||
@@ -363,6 +368,40 @@ export default function InvestmentPath(path: Path) {
|
||||
Os meus investimentos
|
||||
</Link>
|
||||
<h1 className="text-2xl font-semibold">{path.case.title}</h1>
|
||||
{!!path.sector_contexts?.length && (
|
||||
<section className="rounded border p-4">
|
||||
<h2 className="text-lg font-semibold">Contexto setorial</h2>
|
||||
<ul>
|
||||
{path.sector_contexts.map((s) => (
|
||||
<li key={s.id}>
|
||||
<Link className="underline" href={s.href}>
|
||||
{s.name}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<p>
|
||||
Preparação privada nas mesmas cinco fases e 19 etapas; a
|
||||
escolha do setor não publica uma oportunidade.
|
||||
</p>
|
||||
</section>
|
||||
)}
|
||||
{path.fintech && (
|
||||
<FintechInvestment
|
||||
data={path.fintech}
|
||||
caseId={path.case.id}
|
||||
version={path.case.version}
|
||||
canWrite={path.canWrite}
|
||||
documents={path.documents}
|
||||
simulator={path.tools.simulator}
|
||||
fromArticle={
|
||||
path.content_sources.some(
|
||||
(source) => source.return_href === '/tech-fintech',
|
||||
) ||
|
||||
path.sector_contexts.some((s) => s.slug === 'fintech')
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{!!path.content_sources?.length && (
|
||||
<section
|
||||
className="space-y-2 rounded-xl border p-4"
|
||||
|
||||
Reference in New Issue
Block a user