From e6a484358634de1a0f9304251cb32c7b658e03cb Mon Sep 17 00:00:00 2001 From: Marco Pedone Date: Tue, 14 Oct 2025 16:53:15 +0200 Subject: [PATCH] feat: enhance default open logic for service rows and improve transition effects --- .../src/components/tables/ricerca-table.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/infoalloggi/src/components/tables/ricerca-table.tsx b/apps/infoalloggi/src/components/tables/ricerca-table.tsx index a2892d5..bdc23e8 100644 --- a/apps/infoalloggi/src/components/tables/ricerca-table.tsx +++ b/apps/infoalloggi/src/components/tables/ricerca-table.tsx @@ -32,12 +32,20 @@ export const TabRicerca = ({ ); } + const first_choice = data.findIndex((s) => !s.isInterrotto && s.isOkAcconto); + const second_choice = data.findIndex((s) => !s.isInterrotto); + const getDefaultOpen = (idx: number) => { + if (first_choice !== -1) return idx === first_choice; + if (second_choice !== -1) return idx === second_choice; + return idx === 0; + }; + return (
{data.map((servizio, idx) => { return (
- {isOpen ? "👇" : "👉"} + + {isOpen ? "👇" : "👉"} +