@@ -1,5 +1,5 @@
|
||||
import { Link, router } from "@inertiajs/react";
|
||||
import { Frame, card, button } from "./shared";
|
||||
import { Link, router } from '@inertiajs/react';
|
||||
import { Frame, card, button } from './shared';
|
||||
export default function Workspace({
|
||||
submissions,
|
||||
favourites,
|
||||
@@ -18,10 +18,10 @@ export default function Workspace({
|
||||
favourites: { id: number; title: string; slug: string }[];
|
||||
}) {
|
||||
const states: Record<string, string> = {
|
||||
received: "Recebido",
|
||||
in_review: "Em análise",
|
||||
contacted: "Contactado",
|
||||
closed: "Encerrado",
|
||||
received: 'Recebido',
|
||||
in_review: 'Em análise',
|
||||
contacted: 'Contactado',
|
||||
closed: 'Encerrado',
|
||||
};
|
||||
return (
|
||||
<Frame title="Área do investidor">
|
||||
@@ -39,28 +39,38 @@ export default function Workspace({
|
||||
Apoio e parcerias
|
||||
</Link>
|
||||
</nav>
|
||||
<button className={button} onClick={() => router.post("/investidor/manifestacoes")}>
|
||||
<button
|
||||
className={button}
|
||||
onClick={() => router.post('/investidor/manifestacoes')}
|
||||
>
|
||||
Preparar nova manifestação
|
||||
</button>
|
||||
<section className="space-y-4">
|
||||
<h2 className="text-2xl font-bold">Rascunhos e manifestações</h2>
|
||||
<h2 className="text-2xl font-bold">
|
||||
Rascunhos e manifestações
|
||||
</h2>
|
||||
{submissions.data.map((s) => (
|
||||
<article className={card} key={s.id}>
|
||||
<Link
|
||||
href={`/investidor/manifestacoes/${s.id}`}
|
||||
className="font-semibold underline"
|
||||
>
|
||||
{s.reference ?? "Continuar rascunho"}
|
||||
{s.reference ?? 'Continuar rascunho'}
|
||||
</Link>
|
||||
<p>
|
||||
{s.status === "draft"
|
||||
? "Rascunho privado"
|
||||
: (states[s.request_status ?? ""] ?? s.request_status)}
|
||||
{s.status === 'draft'
|
||||
? 'Rascunho privado'
|
||||
: (states[s.request_status ?? ''] ??
|
||||
s.request_status)}
|
||||
</p>
|
||||
<p>
|
||||
{new Date(s.created_at).toLocaleDateString('pt-MZ')}
|
||||
</p>
|
||||
<p>{new Date(s.created_at).toLocaleDateString("pt-MZ")}</p>
|
||||
</article>
|
||||
))}
|
||||
{!submissions.data.length && <p>Ainda não existem manifestações neste percurso.</p>}
|
||||
{!submissions.data.length && (
|
||||
<p>Ainda não existem manifestações neste percurso.</p>
|
||||
)}
|
||||
<nav aria-label="Paginação" className="flex gap-4">
|
||||
{submissions.prev_page_url && (
|
||||
<Link href={submissions.prev_page_url}>Anterior</Link>
|
||||
@@ -73,12 +83,19 @@ export default function Workspace({
|
||||
<section className="space-y-4">
|
||||
<h2 className="text-2xl font-bold">Oportunidades favoritas</h2>
|
||||
{favourites.map((f) => (
|
||||
<Link href={`/oportunidades/${f.slug}`} className={card + " block"} key={f.id}>
|
||||
<Link
|
||||
href={`/oportunidades/${f.slug}`}
|
||||
className={card + ' block'}
|
||||
key={f.id}
|
||||
>
|
||||
{f.title}
|
||||
</Link>
|
||||
))}
|
||||
{!favourites.length && (
|
||||
<p>Explore o catálogo e guarde as oportunidades que pretende acompanhar.</p>
|
||||
<p>
|
||||
Explore o catálogo e guarde as oportunidades que
|
||||
pretende acompanhar.
|
||||
</p>
|
||||
)}
|
||||
</section>
|
||||
</Frame>
|
||||
|
||||
Reference in New Issue
Block a user