import { Button, Heading, Row, Section, Text } from "@react-email/components";
import Base from "./base";

export type ContattoAnnuncio_NewMail = {
	mailType: "contattoAnnuncioEmail";
	props: ContattoAnnuncioEmailProps;
};

type ContattoAnnuncioEmailProps = {
	nome: string;
	codice: string;
	email: string;
	telefono: string;
	messaggio: string;
};
const ContattoAnnuncioEmail = ({
	nome,
	codice,
	email,
	telefono,
	messaggio,
}: ContattoAnnuncioEmailProps) => {
	return (
		<Base preview="Contatto Email">
			<>
				<Heading className="text-center text-3xl leading-8">
					Richiesta di contatto
				</Heading>

				<Section className="px-5 text-left text-base md:px-12">
					<Row>
						<Text>Data: {new Date().toLocaleString()}</Text>
						<Text>Nome: {nome}</Text>
						<Text>Annuncio: {codice}</Text>
						<Text>Telefono: {telefono}</Text>
						<Text>Email: {email}</Text>
						<Text>Messaggio: {messaggio}</Text>
					</Row>
				</Section>
				<Section className="mb-5">
					<Button
						className="mx-auto box-border inline-flex h-10 items-center justify-center whitespace-nowrap rounded-md bg-neutral-100 px-4 py-2 text-center align-middle font-semibold text-neutral-900"
						href={`${process.env.NEXT_PUBLIC_BASE_URL}/annuncio/${codice}`}
					>
						Vai all&apos;annuncio
					</Button>
				</Section>
			</>
		</Base>
	);
};
export default ContattoAnnuncioEmail;
