From dacea2481e9a3df968b011099f768845dce958ec Mon Sep 17 00:00:00 2001 From: Marco Pedone Date: Thu, 18 Dec 2025 15:12:20 +0100 Subject: [PATCH] refactor: remove unused AnnunciInConferma components and clean up form_utils --- .../servizio/servizio_annunci_accordions.tsx | 130 ------------------ apps/infoalloggi/src/lib/form_utils.ts | 17 --- 2 files changed, 147 deletions(-) diff --git a/apps/infoalloggi/src/components/servizio/servizio_annunci_accordions.tsx b/apps/infoalloggi/src/components/servizio/servizio_annunci_accordions.tsx index 551e9ae..b9b0a29 100644 --- a/apps/infoalloggi/src/components/servizio/servizio_annunci_accordions.tsx +++ b/apps/infoalloggi/src/components/servizio/servizio_annunci_accordions.tsx @@ -53,49 +53,6 @@ const DialogServizio = ({ ); }; -export const AnnunciInConfermaDialog = ({ - annunci, -}: { - annunci: ServizioData["annunci"]; -}) => { - const { servizioId, userId } = useServizio(); - return ( - - - - - {annunci.length || 0} - - - } - > -
- {annunci.map((data) => { - return ( - - - - ); - })} -
-
- ); -}; export const AnnunciSelezionatiDialog = ({ annunci, @@ -156,93 +113,6 @@ export const AnnunciSelezionatiDialog = ({ ); }; -export const AnnunciInConfermaAccordion = ({ - annunci, -}: { - annunci: ServizioData["annunci"]; -}) => { - const { servizioId, userId } = useServizio(); - if (annunci.length === 0) { - return null; // If there are no announcements in confirmation, do not render this section - } - - return ( - - - - Annunci in conferma: - - -
- {annunci.map((data) => { - return ( - - - - ); - })} -
-
-
-
- ); -}; - -export const AnnunciSelezionatiAccordion = ({ - annunci, -}: { - annunci: ServizioData["annunci"]; -}) => { - const { servizioId, userId } = useServizio(); - return ( - - - - Annunci Selezionati: - - -
- {annunci.length > 0 ? ( - annunci.map((data) => { - return ( - - - - ); - }) - ) : ( -
- - Nessun annuncio selezionato, fai una ricerca nella pagina{" "} - - Annunci - - {" "} - o tra gli annunci compatibili qui sotto. - -
- )} -
-
-
-
- ); -}; - export const AnnunciRichiesti = ({ userId }: { userId: UsersId }) => { const { data, isLoading } = api.intrests.getUserInterestsAnnunci.useQuery({ userId, diff --git a/apps/infoalloggi/src/lib/form_utils.ts b/apps/infoalloggi/src/lib/form_utils.ts index 1f2d2a8..7ed7578 100644 --- a/apps/infoalloggi/src/lib/form_utils.ts +++ b/apps/infoalloggi/src/lib/form_utils.ts @@ -1,7 +1,6 @@ import dynamic from "next/dynamic"; import type { ChangeEvent } from "react"; import type { z } from "zod/v4"; -import type { ListOption } from "~/components/custom_ui/multiselect"; import type { Comuni } from "~/schemas/public/Comuni"; import type { Nazioni } from "~/schemas/public/Nazioni"; import { ITALY_CATASTO_CODE } from "./catasto"; @@ -22,22 +21,6 @@ export const FormDebug: React.ElementType = ) : () => null; // Return null component in production -export const getComuneFieldValue = ( - fieldValue: string, - comuni_options: string[], -): ListOption | undefined => { - if (fieldValue !== "") { - const num = parseInt(fieldValue); - if (num <= comuni_options.length) { - return { - label: String(comuni_options[num as keyof typeof comuni_options]), - value: String(num), - }; - } - } - return undefined; -}; - const getInizialiCF = (stringa: string) => { const vocali = ["A", "E", "I", "O", "U"]; let iniziali = "";