ResetPasswordEmail.tsx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import * as React from "react";
  2. import { Button, Heading, Hr, Link, Section, Text } from "@react-email/components";
  3. import { SiteConfig } from "@/shared/config/site-config";
  4. import { BaseEmailLayout } from "./utils/BaseEmailLayout"; // Import the layout
  5. interface ResetPasswordEmailProps {
  6. url: string;
  7. }
  8. const primaryColor = "#2563EB"; // Blue-600
  9. export const ResetPasswordEmail = ({ url }: ResetPasswordEmailProps) => (
  10. <BaseEmailLayout previewText={`Reset your password for ${SiteConfig.title}`}>
  11. <Heading className="mb-6 text-center text-2xl font-semibold text-gray-900">🔒 Reset Your Password</Heading>
  12. <Section>
  13. <Text className="text-text text-base leading-relaxed">Hello,</Text>
  14. <Text className="text-text text-base leading-relaxed">
  15. We received a request to reset the password for your {SiteConfig.title} account. If this was you, click the button below to set a
  16. new password:
  17. </Text>
  18. </Section>
  19. <Section className="my-8 text-center">
  20. <Button
  21. className="inline-block rounded-md bg-primary px-6 py-3 text-center text-sm font-medium text-white no-underline transition hover:opacity-90"
  22. href={url}
  23. style={{ backgroundColor: primaryColor }} // Inline style for better email client compatibility
  24. >
  25. Set New Password
  26. </Button>
  27. </Section>
  28. <Section>
  29. <Text className="text-text text-base leading-relaxed">
  30. If you didn&apos;t request a password reset, please ignore this email. Your password will remain unchanged.
  31. </Text>
  32. </Section>
  33. <Hr className="my-6 border-t" />
  34. <Section>
  35. <Text className="text-lightText text-sm leading-normal">
  36. If the button above doesn&apos;t work, you can copy and paste this link into your browser:
  37. </Text>
  38. <Link className="block break-all text-sm text-primary hover:underline" href={url}>
  39. {url}
  40. </Link>
  41. </Section>
  42. {/* Footer is now handled by BaseEmailLayout */}
  43. </BaseEmailLayout>
  44. );
  45. export default ResetPasswordEmail; // Keep export consistent