| 1 | import { Section, Text } from '@react-email/components' |
| 2 | import { env } |
| 3 | import { |
| 4 | ActionButton, |
| 5 | EmailLayout, |
| 6 | InfoCard, |
| 7 | InfoRow, |
| 8 | text, |
| 9 | } from '../components/layout' |
| 10 | |
| 11 | const baseUrl = env |
| 12 | |
| 13 | interface TimesheetApprovedEmailProps { |
| 14 | approverName: string |
| 15 | entryCount: number |
| 16 | orgSlug: string |
| 17 | projectName: string |
| 18 | projectSlug: string |
| 19 | recipientName: string |
| 20 | totalHours: string |
| 21 | weekLabel: string |
| 22 | } |
| 23 | |
| 24 | export default function TimesheetApprovedEmail |
| 25 | recipientName = 'Jane Smith' |
| 26 | approverName = 'John Doe' |
| 27 | projectName = 'Website Redesign' |
| 28 | totalHours = '32.5' |
| 29 | weekLabel = 'Mar 3 – Mar 9, 2026' |
| 30 | entryCount = 8, |
| 31 | orgSlug = 'acme' |
| 32 | projectSlug = 'website-redesign' |
| 33 | }: TimesheetApprovedEmailProps) |
| 34 | return ( |
| 35 | <EmailLayout |
| 36 | accentColor='#16a34a' |
| 37 | heading='Timesheet approved' |
| 38 | preview={`Your timesheet for ${projectName |
| 39 | > |
| 40 | <Text style={ |
| 41 | Hi {recipientName}, <span |
| 42 | approved your timesheet for{' '} |
| 43 | <span style={text |
| 44 | </Text> |
| 45 | <Section style={ |
| 46 | <Text style={ |
| 47 | <Text style={ |
| 48 | </Section> |
| 49 | <InfoCard> |
| 50 | <InfoRow label=' |
| 51 | <InfoRow |
| 52 | label='Entries' |
| 53 | value={`${entryCount |
| 54 | /> |
| 55 | </InfoCard> |
| 56 | <ActionButton |
| 57 | color='#16a34a' |
| 58 | href={`${baseUrl |
| 59 | > |
| 60 | View Timesheet |
| 61 | </ActionButton> |
| 62 | </EmailLayout> |
| 63 | ) |
| 64 | } |
| 65 | |
| 66 | const hoursSection = { |
| 67 | textAlign: 'center' as |
| 68 | padding: '20px 0 8px', |
| 69 | } |
| 70 | |
| 71 | const hoursLabel = { |
| 72 | fontSize: '13px', |
| 73 | color: '#71717a', |
| 74 | fontWeight: '500' as |
| 75 | margin: '0 0 4px', |
| 76 | textAlign: 'center' as |
| 77 | textTransform: 'uppercase' as |
| 78 | letterSpacing: '0.5px', |
| 79 | } |