infoalloggi-monorepo/apps/infoalloggi/src/components/annunci_grid.tsx

36 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-08-28 10:29:04 +02:00
import { CardAnnuncio } from "~/components/annuncio_card";
2025-08-28 18:27:07 +02:00
import { getTitoloTranslation } from "~/lib/annuncio_details";
2025-08-04 17:45:44 +02:00
import { useTranslation } from "~/providers/I18nProvider";
import type { AnnuncioRicerca } from "~/server/controllers/annunci.controller";
export const AnnunciGrid = ({ pagedata }: { pagedata: AnnuncioRicerca[] }) => {
2025-08-28 18:27:07 +02:00
const { locale } = useTranslation();
2025-08-04 17:45:44 +02:00
2025-08-28 18:27:07 +02:00
return (
<div className="relative z-0 mx-auto grid max-w-7xl grid-flow-row grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
{pagedata.map((annuncio) => (
<CardAnnuncio
2025-08-29 16:18:32 +02:00
camere={annuncio.numero_camere}
codice={annuncio.codice}
comune={annuncio.comune}
consegna={annuncio.consegna}
2025-08-28 18:27:07 +02:00
id={annuncio.id}
2025-08-29 16:18:32 +02:00
immagini={annuncio.url_immagini || undefined}
2025-08-28 18:27:07 +02:00
key={annuncio.codice}
2025-08-29 16:18:32 +02:00
mq={annuncio.mq}
2025-08-28 18:27:07 +02:00
prezzo={annuncio.prezzo}
2025-08-29 16:18:32 +02:00
provincia={annuncio.provincia}
stato={annuncio.stato}
tipo={annuncio.tipo}
2025-08-28 18:27:07 +02:00
titolo={getTitoloTranslation({
locale: locale,
titolo_en: annuncio.titolo_en,
2025-08-29 16:18:32 +02:00
titolo_it: annuncio.titolo_it,
2025-08-28 18:27:07 +02:00
})}
videos={annuncio.url_video || undefined}
2025-08-28 18:27:07 +02:00
/>
))}
</div>
);
2025-08-04 17:45:44 +02:00
};