import { Heading, Preview, Text } from "@react-email/components"; import * as React from "react"; import { getTranslation } from "@turbostarter/i18n/server"; import { getOrigin } from "@turbostarter/shared/utils"; import { Button } from "../_components/button"; import { Layout } from "../_components/layout/layout"; import type { EmailTemplate, EmailVariables, CommonEmailProps, } from "../../types"; type Props = EmailVariables[typeof EmailTemplate.DELETE_ACCOUNT] & CommonEmailProps; export const DeleteAccount = async ({ url, locale }: Props) => { const { t } = await getTranslation({ locale, ns: "auth" }); const origin = getOrigin(url); return ( {t("account.delete.email.preview")} {t("account.delete.email.subject")} {t("account.delete.email.body")} {t("account.delete.email.or")} {url} {t("account.delete.email.disclaimer")} ); }; DeleteAccount.subject = async ({ locale }: CommonEmailProps) => { const { t } = await getTranslation({ locale, ns: "auth" }); return t("account.delete.email.subject"); }; DeleteAccount.PreviewProps = { url: "http://localhost:3000/api/auth/delete-user/callback?token=123&callbackURL=/", locale: "en", }; export default DeleteAccount;