VerifyEmail.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 VerifyEmailProps {
  6. url: string;
  7. }
  8. const primaryColor = "#2563EB"; // Blue-600
  9. export const VerifyEmail = ({ url }: VerifyEmailProps) => (
  10. <BaseEmailLayout previewText={`Verify your email address for ${SiteConfig.title}`}>
  11. <Heading className="mb-6 text-center text-2xl font-semibold text-gray-900">✅ Verify Your Email</Heading>
  12. <Section>
  13. <Text className="text-text text-base leading-relaxed">Welcome to {SiteConfig.title}!</Text>
  14. <Text className="text-text text-base leading-relaxed">
  15. Please click the button below to verify your email address and complete your signup or login:
  16. </Text>
  17. </Section>
  18. <Section className="my-8 text-center">
  19. <Button
  20. 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"
  21. href={url}
  22. style={{ backgroundColor: primaryColor }} // Inline style for better email client compatibility
  23. >
  24. Verify Email Address
  25. </Button>
  26. </Section>
  27. <Section>
  28. <Text className="text-text text-base leading-relaxed">If you didn&apos;t request this email, you can safely ignore it.</Text>
  29. </Section>
  30. <Hr className="my-6 border-t" />
  31. <Section>
  32. <Text className="text-lightText text-sm leading-normal">
  33. If the button above doesn&apos;t work, you can copy and paste this link into your browser:
  34. </Text>
  35. <Link className="block break-all text-sm text-primary hover:underline" href={url}>
  36. {url}
  37. </Link>
  38. </Section>
  39. {/* Footer is now handled by BaseEmailLayout */}
  40. </BaseEmailLayout>
  41. );