import { Link, Section, Text } from '@react-email/components'; import * as React from 'react'; import { content, link, paragraph } from '../css/styles'; import { getGreetingName, MailBody } from '../partials/partials'; interface PageUpdate { title: string; url: string; updatedBy: string[]; } interface Props { userName: string; pageUpdates: PageUpdate[]; totalUpdates: number; } export const PageUpdateDigestEmail = ({ userName, pageUpdates, totalUpdates, }: Props) => { return (
Hi {getGreetingName(userName)}, There {totalUpdates === 1 ? 'has' : 'have'} been{' '} {totalUpdates} update{totalUpdates === 1 ? '' : 's'} {' '} since your last update. {pageUpdates.map((page, i) => (
{page.title} {page.updatedBy.length > 0 && ( Edited by {page.updatedBy.join(', ')} )}
))}
); }; const pageCard = { borderLeft: '3px solid #e8e5ef', paddingLeft: '12px', marginBottom: '12px', }; const pageTitle = { ...paragraph, margin: '0 0 2px 0', fontSize: 14, fontWeight: 'bold' as const, }; const updatedByText = { ...paragraph, margin: '0', fontSize: 13, color: '#666', }; export default PageUpdateDigestEmail;