@@ -1,8 +1,11 @@
|
||||
import ProfileNavigation from '@/components/profile-navigation';
|
||||
import { Head, Link } from '@inertiajs/react';
|
||||
import { dashboard } from '@/routes';
|
||||
import type { InvestmentContext } from '@/pages/investor-path/index';
|
||||
import type { OpportunityManagementAccess } from '@/types/opportunity-management';
|
||||
|
||||
type Summary = {
|
||||
canCreateOpportunity?: boolean;
|
||||
requestsByStatus: Record<string, number>;
|
||||
publishedOpportunities: number;
|
||||
draftOpportunities: number;
|
||||
@@ -27,8 +30,10 @@ const card =
|
||||
export default function Dashboard({
|
||||
summary,
|
||||
investorPath,
|
||||
opportunityManagement,
|
||||
}: {
|
||||
summary: Summary | null;
|
||||
opportunityManagement?: OpportunityManagementAccess | null;
|
||||
investorPath?: {
|
||||
contexts: InvestmentContext[];
|
||||
current: {
|
||||
@@ -45,8 +50,53 @@ export default function Dashboard({
|
||||
<main className="space-y-8 p-4 md:p-8">
|
||||
<Head title="Painel" />
|
||||
<h1 className="text-2xl font-semibold">Painel do portal</h1>
|
||||
<ProfileNavigation />
|
||||
{summary ? (
|
||||
<>
|
||||
{opportunityManagement && (
|
||||
<section
|
||||
aria-label="Gestão de Oportunidades"
|
||||
className="space-y-4 rounded-xl border p-5"
|
||||
>
|
||||
<h2 className="text-lg font-semibold">
|
||||
Gestão de Oportunidades
|
||||
</h2>
|
||||
<nav
|
||||
aria-label="Ações de oportunidades"
|
||||
className="flex flex-wrap gap-3"
|
||||
>
|
||||
<Link
|
||||
className="rounded-lg border px-4 py-2 underline"
|
||||
href={opportunityManagement.manage.href}
|
||||
>
|
||||
{opportunityManagement.manage.label}
|
||||
</Link>
|
||||
{opportunityManagement.installed ? (
|
||||
<Link
|
||||
className="bg-primary text-primary-foreground rounded-lg px-4 py-2"
|
||||
href={opportunityManagement.create.href}
|
||||
>
|
||||
{opportunityManagement.create.label}
|
||||
</Link>
|
||||
) : (
|
||||
<Link
|
||||
className="underline"
|
||||
href={
|
||||
opportunityManagement.installationHref
|
||||
}
|
||||
>
|
||||
Preparar instalação da gestão de
|
||||
rascunhos
|
||||
</Link>
|
||||
)}
|
||||
</nav>
|
||||
<p className="text-muted-foreground text-sm">
|
||||
Os rascunhos de oportunidades não publicam o
|
||||
dossier privado do investidor. Publicação exige
|
||||
uma ação própria.
|
||||
</p>
|
||||
</section>
|
||||
)}
|
||||
<section className="space-y-4">
|
||||
<h2 className="text-lg font-semibold">
|
||||
Manifestações de interesse
|
||||
@@ -71,7 +121,9 @@ export default function Dashboard({
|
||||
<section className="space-y-4">
|
||||
<h2 className="text-lg font-semibold">
|
||||
<Link href="/management/opportunities">
|
||||
Gestão de Oportunidades
|
||||
{opportunityManagement
|
||||
? 'Indicadores de oportunidades'
|
||||
: 'Gestão de Oportunidades'}
|
||||
</Link>
|
||||
</h2>
|
||||
<div className="grid gap-4 sm:grid-cols-3">
|
||||
@@ -163,12 +215,13 @@ export default function Dashboard({
|
||||
aria-label="Acções rápidas"
|
||||
className="flex flex-wrap gap-4"
|
||||
>
|
||||
<Link
|
||||
{summary.canCreateOpportunity !== false && <Link
|
||||
className="underline"
|
||||
href="/management/opportunities/create"
|
||||
>
|
||||
Criar oportunidade
|
||||
</Link>
|
||||
{opportunityManagement?.create.label ??
|
||||
'Criar oportunidade'}
|
||||
</Link>}
|
||||
<Link
|
||||
className="underline"
|
||||
href="/management/sectors/create"
|
||||
|
||||
Reference in New Issue
Block a user