47 lines
1.1 KiB
TypeScript
47 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")} →
|
||
|
|
</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;
|