Files
Investidor-V2/resources/js/pages/investment/business-opportunity.tsx
T
nala cf003c8623
tests / ci (push) Canceled after 0s
versao nrgocios 4
2026-10-18 15:57:06 +02:00

95 lines
3.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Link } from '@inertiajs/react';
import { Frame, button, card } from './shared';
import { businessModalities } from './business-types';
import PartnershipSourceLinks from '@/components/partnership-source-links';
import {
ClassificationSummary,
type PublicClassification,
} from '@/components/opportunity-classification';
type Business = {
multidimensional?: PublicClassification[];
id: string;
slug: string;
title: string;
modality: string;
objective?: string | null;
stage?: string | null;
activity_code?: string | null;
amount_min?: string | null;
amount_max?: string | null;
available_percentage?: string | null;
currency?: string | null;
province?: string | null;
district?: string | null;
locality?: string | null;
sector?: { name: string; slug: string } | null;
};
export default function BusinessOpportunity({
record,
returnUrl = '/negocios',
interestUrl = `/negocios/${record.slug}/manifestar-interesse`,
}: {
record: Business;
returnUrl?: string;
interestUrl?: string;
}) {
return (
<Frame title={record.title}>
<Link
className={button}
href={'/investimentos/iniciar?source=business:' + record.id}
>
Iniciar ou continuar investimento com este negócio
</Link>
<PartnershipSourceLinks type="business" id={record.id} />
<Link href={returnUrl} className="underline">
Voltar às oportunidades
</Link>
<section className={`${card} space-y-4`}>
{!!record.multidimensional?.length && (
<ClassificationSummary rows={record.multidimensional} />
)}
<p>{businessModalities[record.modality] ?? record.modality}</p>
<p>
{[record.sector?.name, record.stage, record.activity_code]
.filter(Boolean)
.join(' · ')}
</p>
{(record.province || record.district || record.locality) && (
<p>
{[record.locality, record.district, record.province]
.filter(Boolean)
.join(', ')}
</p>
)}
{(record.amount_min || record.amount_max) && (
<p>
Montante indicativo: {record.amount_min ?? '—'} –{' '}
{record.amount_max ?? '—'} {record.currency}
</p>
)}
{record.available_percentage && (
<p>Participação indicada: {record.available_percentage}%</p>
)}
{record.objective && (
<div>
<h2 className="font-bold">Objectivo</h2>
<p className="whitespace-pre-wrap">
{record.objective}
</p>
</div>
)}
<p className="text-sm">
A publicação não constitui garantia de titularidade,
avaliação, transmissibilidade ou retorno.
</p>
<Link className={button} href={interestUrl}>
Manifestar interesse
</Link>
</section>
</Frame>
);
}