diff --git a/apps/demo/emails/magic-links/aws-verify-email.tsx b/apps/demo/emails/magic-links/aws-verify-email.tsx index 3d1b022116..b9e4b8a451 100644 --- a/apps/demo/emails/magic-links/aws-verify-email.tsx +++ b/apps/demo/emails/magic-links/aws-verify-email.tsx @@ -11,11 +11,13 @@ import { Section, Text, } from "@react-email/components"; -import { setupForPreview } from "react-email"; +import { z } from "zod"; -interface AWSVerifyEmailProps { - verificationCode: string; -} +const AWSVerifyEmailProps = z.object({ + verificationCode: z.string() +}); + +type AWSVerifyEmailProps = z.infer; const baseUrl = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` @@ -84,12 +86,11 @@ export default function AWSVerifyEmail({ ); } -setupForPreview(AWSVerifyEmail, { - verificationCode: { - type: "text", - defaultValue: "596853", - }, -}); +AWSVerifyEmail.PreviewProps = { + verificationCode: '596583' +} satisfies AWSVerifyEmailProps; + +AWSVerifyEmail.PreviewSchema = AWSVerifyEmailProps; const main = { backgroundColor: "#fff", diff --git a/apps/demo/package.json b/apps/demo/package.json index f6a10a122a..967c022080 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -12,12 +12,13 @@ "@react-email/components": "workspace:*", "react": "^19", "react-dom": "^19", - "react-email": "workspace:*" + "react-email": "workspace:*", + "zod": "3.24.1" }, "devDependencies": { - "next": "15.1.2", "@types/react": "^19", "@types/react-dom": "^19", + "next": "15.1.2", "tsx": "4.9.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71ca543eca..45ba4a9342 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,6 +62,9 @@ importers: react-email: specifier: workspace:* version: link:../../packages/react-email + zod: + specifier: 3.24.1 + version: 3.24.1 devDependencies: '@types/react': specifier: ^19 @@ -8249,6 +8252,9 @@ packages: zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + zod@3.24.1: + resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} + snapshots: '@alloc/quick-lru@5.2.0': {} @@ -16263,3 +16269,5 @@ snapshots: yocto-queue@1.1.1: {} zod@3.23.8: {} + + zod@3.24.1: {}