2025-08-04 17:45:44 +02:00
|
|
|
import {
|
2025-08-28 18:27:07 +02:00
|
|
|
Heading,
|
|
|
|
|
Img,
|
|
|
|
|
Link,
|
|
|
|
|
Row,
|
|
|
|
|
Section,
|
|
|
|
|
Text,
|
2025-08-04 17:45:44 +02:00
|
|
|
} from "@react-email/components";
|
2025-10-20 17:27:32 +02:00
|
|
|
import { env } from "~/env";
|
2025-08-04 17:45:44 +02:00
|
|
|
import Base from "./base";
|
2026-01-27 16:30:19 +01:00
|
|
|
export type ShareAnnunci_NewMail = {
|
|
|
|
|
mailType: "shareAnnunci";
|
|
|
|
|
props: ShareAnnunciProps;
|
2025-08-04 17:45:44 +02:00
|
|
|
};
|
|
|
|
|
|
2026-01-27 16:30:19 +01:00
|
|
|
type ShareAnnunciProps = {
|
2025-08-28 18:27:07 +02:00
|
|
|
nome: string;
|
|
|
|
|
annunci?: {
|
|
|
|
|
titolo: string | null;
|
|
|
|
|
immagine: string | null;
|
|
|
|
|
codice: string;
|
|
|
|
|
prezzo: number;
|
|
|
|
|
}[];
|
2025-08-04 17:45:44 +02:00
|
|
|
};
|
|
|
|
|
|
2026-01-27 16:30:19 +01:00
|
|
|
const ShareAnnunci = ({ nome, annunci }: ShareAnnunciProps) => {
|
2025-08-28 18:27:07 +02:00
|
|
|
return (
|
|
|
|
|
<Base preview="Procedi ora su Infoalloggi.it">
|
|
|
|
|
<>
|
|
|
|
|
<Heading className="text-center text-3xl leading-8">
|
|
|
|
|
Procedi ora su Infoalloggi.it
|
|
|
|
|
</Heading>
|
|
|
|
|
<Section className="px-5 text-left text-base md:px-12">
|
|
|
|
|
<Row>
|
|
|
|
|
<Text>
|
|
|
|
|
Ciao {nome},<br />
|
|
|
|
|
Accedi ora al servizio di ricerca Infoalloggi, dove potrai andare
|
|
|
|
|
a contattare direttamente i proprietari degli immobili
|
|
|
|
|
disponibili.
|
|
|
|
|
</Text>
|
|
|
|
|
</Row>
|
2026-01-27 16:47:02 +01:00
|
|
|
|
2025-08-28 18:27:07 +02:00
|
|
|
<Section>
|
2026-01-27 16:47:02 +01:00
|
|
|
<Text className="font-semibold">Annunci selezionati per te:</Text>
|
2025-10-28 11:55:01 +01:00
|
|
|
{annunci?.map((annuncio) => (
|
2025-08-28 18:27:07 +02:00
|
|
|
<>
|
2026-01-20 18:38:17 +01:00
|
|
|
<Section className="mb-7.5" key={annuncio.codice}>
|
|
|
|
|
<Row className="mb-3">
|
2025-08-28 18:27:07 +02:00
|
|
|
<Img
|
|
|
|
|
alt={`Annuncio image - ${annuncio.codice}`}
|
2026-01-27 16:47:02 +01:00
|
|
|
className="block w-60 rounded-md object-cover object-center"
|
2025-08-29 16:18:32 +02:00
|
|
|
height="140px"
|
2025-11-28 15:11:14 +01:00
|
|
|
src={`${env.BASE_URL}/storage-api/get/${annuncio.immagine}?media=image`}
|
2025-08-29 16:18:32 +02:00
|
|
|
width="100%"
|
2025-08-28 18:27:07 +02:00
|
|
|
/>
|
|
|
|
|
</Row>
|
2025-10-10 16:18:43 +02:00
|
|
|
<Row className="block w-full">
|
2026-01-27 16:47:02 +01:00
|
|
|
<div className="mb-1 w-fit rounded-md bg-indigo-600 px-2 font-semibold text-sm text-white">
|
|
|
|
|
<strong>Codice: {annuncio.codice}</strong>
|
2025-08-28 18:27:07 +02:00
|
|
|
</div>
|
|
|
|
|
<Heading
|
|
|
|
|
as="h2"
|
2026-01-20 18:38:17 +01:00
|
|
|
className="mt-0 mb-1.5 font-bold text-[16px] leading-none"
|
2025-08-28 18:27:07 +02:00
|
|
|
>
|
|
|
|
|
{annuncio.titolo || "N/A"}
|
|
|
|
|
</Heading>
|
2026-01-20 18:38:17 +01:00
|
|
|
<Text className="m-0 text-[14px] text-gray-500 leading-6">
|
2025-08-28 18:27:07 +02:00
|
|
|
<strong>Prezzo:</strong> €
|
|
|
|
|
{(annuncio.prezzo / 1e2).toFixed(2)}
|
|
|
|
|
</Text>
|
|
|
|
|
<Link
|
2025-10-10 16:18:43 +02:00
|
|
|
className="block font-semibold text-[14px] text-indigo-600 no-underline"
|
2025-10-20 17:27:32 +02:00
|
|
|
href={`${env.BASE_URL}/annuncio/${annuncio.codice}`}
|
2025-08-28 18:27:07 +02:00
|
|
|
>
|
|
|
|
|
Scheda dell'annuncio →
|
|
|
|
|
</Link>
|
|
|
|
|
</Row>
|
|
|
|
|
</Section>
|
|
|
|
|
</>
|
|
|
|
|
))}
|
|
|
|
|
</Section>
|
|
|
|
|
</Section>
|
|
|
|
|
</>
|
|
|
|
|
</Base>
|
|
|
|
|
);
|
2025-08-04 17:45:44 +02:00
|
|
|
};
|
|
|
|
|
|
2026-01-27 16:30:19 +01:00
|
|
|
export default ShareAnnunci;
|