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(
|
const openContattiAnnunci = servizio.annunci.filter(
|
||||||
(a) => a.open_contatti_at !== null,
|
(a) => a.open_contatti_at !== null && a.user_confirmed_at === null,
|
||||||
).length;
|
|
||||||
|
);
|
||||||
|
|
||||||
const annunciInConferma = servizio.annunci.filter(
|
const annunciInConferma = servizio.annunci.filter(
|
||||||
(a) => a.user_confirmed_at !== null,
|
(a) => a.user_confirmed_at !== null,
|
||||||
|
|
@ -211,9 +212,9 @@ export const ServizioContent = () => {
|
||||||
<UserCircle className="size-6 text-primary" />
|
<UserCircle className="size-6 text-primary" />
|
||||||
<span className="font-medium">Contatti sbloccati</span>
|
<span className="font-medium">Contatti sbloccati</span>
|
||||||
</div>
|
</div>
|
||||||
<span className="text-sm">{openContattiCount} / 10</span>
|
<span className="text-sm">{openContattiAnnunci.length} / 10</span>
|
||||||
</div>
|
</div>
|
||||||
<Progress className="h-2" value={openContattiCount * 10} />
|
<Progress className="h-2" value={openContattiAnnunci.length * 10} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ServizioDuration decorrenza={servizio.decorrenza} />
|
<ServizioDuration decorrenza={servizio.decorrenza} />
|
||||||
|
|
@ -255,6 +256,15 @@ export const ServizioContent = () => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="flex flex-col gap-4">
|
<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">
|
<div className="flex flex-col gap-2 overflow-y-auto">
|
||||||
{annunciInConferma.map((data) => {
|
{annunciInConferma.map((data) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue