feat(servizio): Update open contacts display logic and add mapping for open contacts announcements
This commit is contained in:
parent
66ef4a7fbd
commit
6a72261c91
1 changed files with 15 additions and 5 deletions
|
|
@ -190,9 +190,10 @@ export const ServizioContent = () => {
|
|||
);
|
||||
}
|
||||
|
||||
const openContattiCount = servizio.annunci.filter(
|
||||
(a) => a.open_contatti_at !== null,
|
||||
).length;
|
||||
const openContattiAnnunci = servizio.annunci.filter(
|
||||
(a) => a.open_contatti_at !== null && a.user_confirmed_at === null,
|
||||
|
||||
);
|
||||
|
||||
const annunciInConferma = servizio.annunci.filter(
|
||||
(a) => a.user_confirmed_at !== null,
|
||||
|
|
@ -211,9 +212,9 @@ export const ServizioContent = () => {
|
|||
<UserCircle className="size-6 text-primary" />
|
||||
<span className="font-medium">Contatti sbloccati</span>
|
||||
</div>
|
||||
<span className="text-sm">{openContattiCount} / 10</span>
|
||||
<span className="text-sm">{openContattiAnnunci.length} / 10</span>
|
||||
</div>
|
||||
<Progress className="h-2" value={openContattiCount * 10} />
|
||||
<Progress className="h-2" value={openContattiAnnunci.length * 10} />
|
||||
</div>
|
||||
|
||||
<ServizioDuration decorrenza={servizio.decorrenza} />
|
||||
|
|
@ -255,6 +256,15 @@ export const ServizioContent = () => {
|
|||
</div>
|
||||
)}
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex flex-col gap-2 overflow-y-auto">
|
||||
{openContattiAnnunci.map((data) => {
|
||||
return (
|
||||
<ServizioAnnuncioProvider data={data} key={data.id}>
|
||||
<AnnuncioCard className="border-2 border-green-500" />
|
||||
</ServizioAnnuncioProvider>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div className="flex flex-col gap-2 overflow-y-auto">
|
||||
{annunciInConferma.map((data) => {
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue