feat(offers): add gated phase three public catalogue in QA
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
import { modalityLabels } from '@/components/opportunity-search-filters';
|
||||
import { offerPrice, type PublicOffer } from '@/lib/public-offer';
|
||||
import { card } from '@/pages/investment/shared';
|
||||
|
||||
export default function PublicOfferCard({
|
||||
offer,
|
||||
detail = false,
|
||||
}: {
|
||||
offer: PublicOffer;
|
||||
detail?: boolean;
|
||||
}) {
|
||||
const Heading = detail ? 'h1' : 'h2';
|
||||
return (
|
||||
<article className={`${card} min-w-0 space-y-3 break-words`}>
|
||||
<p className="text-sm text-slate-600">
|
||||
{modalityLabels[offer.category]} ·{' '}
|
||||
{offer.location.map((node) => node.name).join(' / ') ||
|
||||
'Localização não indicada'}
|
||||
</p>
|
||||
<Heading className="text-xl font-semibold">
|
||||
{detail ? (
|
||||
offer.title
|
||||
) : (
|
||||
<Link
|
||||
className="underline decoration-emerald-700 underline-offset-4"
|
||||
href={offer.url}
|
||||
>
|
||||
{offer.title}
|
||||
</Link>
|
||||
)}
|
||||
</Heading>
|
||||
<p className="whitespace-pre-line">{offer.summary}</p>
|
||||
<p className="font-semibold text-emerald-900">
|
||||
{offerPrice(offer.price)}
|
||||
</p>
|
||||
<p className="text-sm text-slate-600">
|
||||
Publicada em{' '}
|
||||
{new Date(offer.published_at).toLocaleDateString('pt-MZ')}
|
||||
</p>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user