better-auth/packages/mail/emails/ForgotPassword.tsx
 Илья Шалонин 8538ab969a first
2025-10-29 13:43:43 +05:00

46 lines
1.1 KiB
TypeScript

import { Link, Text } from "@react-email/components";
import React from "react";
import { createTranslator } from "use-intl/core";
import PrimaryButton from "../src/components/PrimaryButton";
import Wrapper from "../src/components/Wrapper";
import { defaultLocale } from "../src/util/translations";
import { defaultTranslations } from "../src/util/translations";
import type { BaseMailProps } from "../types";
export function ForgotPassword({
url,
locale,
translations,
}: {
url: string;
name: string;
} & BaseMailProps) {
const t = createTranslator({
locale,
messages: translations,
});
return (
<Wrapper>
<Text>{t("mail.forgotPassword.body")}</Text>
<PrimaryButton href={url}>
{t("mail.forgotPassword.resetPassword")} &rarr;
</PrimaryButton>
<Text className="text-muted-foreground text-sm">
{t("mail.common.openLinkInBrowser")}
<Link href={url}>{url}</Link>
</Text>
</Wrapper>
);
}
ForgotPassword.PreviewProps = {
locale: defaultLocale,
translations: defaultTranslations,
url: "#",
name: "John Doe",
};
export default ForgotPassword;