| 1 | import { Text } from '@react-email/components' |
| 2 | import { env } |
| 3 | import { |
| 4 | ActionButton, |
| 5 | Badge, |
| 6 | EmailLayout, |
| 7 | InfoCard, |
| 8 | InfoRow, |
| 9 | text, |
| 10 | } from '../components/layout' |
| 11 | |
| 12 | const baseUrl = env |
| 13 | |
| 14 | interface TimesheetClientRespondedEmailProps { |
| 15 | action: 'approved |
| 16 | clientName: string |
| 17 | disputeReason?: string |
| 18 | orgSlug: string |
| 19 | projectName: string |
| 20 | projectSlug: string |
| 21 | recipientName: string |
| 22 | reportId: string |
| 23 | reportTitle: string |
| 24 | totalHours: string |
| 25 | } |
| 26 | |
| 27 | export default function TimesheetClientRespondedEmail |
| 28 | recipientName = 'John Doe' |
| 29 | clientName = 'Jane Smith' |
| 30 | projectName = 'Website Redesign' |
| 31 | reportTitle = 'Week of Mar 3 – Mar 9, 2026' |
| 32 | totalHours = '32.5' |
| 33 | action = 'approved' |
| 34 | disputeReason, |
| 35 | orgSlug = 'acme' |
| 36 | projectSlug = 'website-redesign' |
| 37 | reportId = 'tr_abc123' |
| 38 | }: TimesheetClientRespondedEmailProps) |
| 39 | const isApproved = |
| 40 | |
| 41 | return ( |
| 42 | <EmailLayout |
| 43 | accentColor={isApproved ? |
| 44 | heading={`Timesheet ${isApproved |
| 45 | preview={`Timesheet ${action |
| 46 | > |
| 47 | <Text style={ |
| 48 | Hi {recipientName}, <span |
| 49 | {isApproved ? 'approved |
| 50 | <span style={text |
| 51 | </Text> |
| 52 | <InfoCard> |
| 53 | <InfoRow label=' |
| 54 | <InfoRow label=' |
| 55 | <InfoRow |
| 56 | label='Status' |
| 57 | value={ |
| 58 | <Badge color={ |
| 59 | {isApproved ? 'Approved |
| 60 | </Badge> |
| 61 | } |
| 62 | /> |
| 63 | </InfoCard> |
| 64 | {!isApproved && disputeReason |
| 65 | <InfoCard> |
| 66 | <InfoRow label=' |
| 67 | </InfoCard> |
| 68 | )} |
| 69 | <ActionButton |
| 70 | href={`${baseUrl |
| 71 | > |
| 72 | View Details |
| 73 | </ActionButton> |
| 74 | </EmailLayout> |
| 75 | ) |
| 76 | } |