import { Container } from '@react-email/container'; import { Html } from '@react-email/html'; import { Section } from '@react-email/section'; import { Text } from '@react-email/text'; import { z } from 'zod'; import { NewsSchema } from '../../utils/schemas'; import { Footer } from './components/footer'; export default function NewsletterTemplate( stories: z.infer[] ) { const sayings = [ 'hot off the press', 'straight from the oven', "straight from the horse's mouth", 'brand spanking new', 'fresh as a daisy', 'straight out of the box', 'straight off the assembly line', 'hot out of the kitchen', 'just minted', 'freshly brewed', 'just off the production line' ]; return { subject: `What's new from Hackernews?`, template: (

Good day!

Here is something{' '} {sayings[Math.floor(Math.random() * sayings.length)]}:

{stories.map(story => { return (

{story.title}

{story.by}

{story.text && (

500 ? story.text.substring(0, 500) + '...' : story.text }} />

)} {story.url && ( )}
); })}
) }; } const main = { backgroundColor: '#ffffff' }; const container = { margin: '0 auto', padding: '20px 0 48px', width: '580px' };