@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user