refactor(annunci_grid): Simplify CardAnnuncio props by spreading pagedata
This commit is contained in:
parent
bb293bbd4a
commit
7a2e3eb862
1 changed files with 1 additions and 23 deletions
|
|
@ -4,32 +4,10 @@ import { useTranslation } from "~/providers/I18nProvider";
|
||||||
import type { AnnuncioRicerca } from "~/server/controllers/annunci.controller";
|
import type { AnnuncioRicerca } from "~/server/controllers/annunci.controller";
|
||||||
|
|
||||||
export const AnnunciGrid = ({ pagedata }: { pagedata: AnnuncioRicerca[] }) => {
|
export const AnnunciGrid = ({ pagedata }: { pagedata: AnnuncioRicerca[] }) => {
|
||||||
const { locale } = useTranslation();
|
|
||||||
|
|
||||||
return (
|
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">
|
<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) => (
|
{pagedata.map((annuncio) => (
|
||||||
<CardAnnuncio
|
<CardAnnuncio key={annuncio.codice} {...annuncio} />
|
||||||
camere={annuncio.numero_camere}
|
|
||||||
codice={annuncio.codice}
|
|
||||||
comune={annuncio.comune}
|
|
||||||
consegna={annuncio.consegna}
|
|
||||||
id={annuncio.id}
|
|
||||||
images={annuncio.images}
|
|
||||||
key={annuncio.codice}
|
|
||||||
mq={annuncio.mq}
|
|
||||||
prezzo={annuncio.prezzo}
|
|
||||||
provincia={annuncio.provincia}
|
|
||||||
stato={annuncio.stato}
|
|
||||||
tipo={annuncio.tipo}
|
|
||||||
titolo={getTitoloTranslation({
|
|
||||||
locale: locale,
|
|
||||||
titolo_en: annuncio.titolo_en,
|
|
||||||
titolo_it: annuncio.titolo_it,
|
|
||||||
})}
|
|
||||||
updated_at={annuncio.updated_at}
|
|
||||||
videos={annuncio.url_video || undefined}
|
|
||||||
/>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue