import { useLingui } from '@lingui/react'; import { Trans } from '@lingui/react/macro'; import type { RecipientRole } from '@prisma/client'; import { match } from 'ts-pattern'; import { RECIPIENT_ROLES_DESCRIPTION } from '@documenso/lib/constants/recipient-roles'; import { Button, Section, Text } from '../components'; import { TemplateDocumentImage } from './template-document-image'; export interface TemplateDocumentReminderProps { recipientName: string; documentName: string; signDocumentLink: string; assetBaseUrl: string; role: RecipientRole; } export const TemplateDocumentReminder = ({ recipientName, documentName, signDocumentLink, assetBaseUrl, role, }: TemplateDocumentReminderProps) => { const { _ } = useLingui(); const { actionVerb } = RECIPIENT_ROLES_DESCRIPTION[role]; return ( <>
{/* Reminder specific text */} Reminder: Please {_(actionVerb).toLowerCase()} your document
"{documentName}"
{/* Addressee */} Hi {recipientName}, {/* Reminder Call to Action */} {match(role) .with('SIGNER', () => Continue by signing the document.) .with('VIEWER', () => Continue by viewing the document.) .with('APPROVER', () => Continue by approving the document.) .with('CC', () => '') .with('ASSISTANT', () => Continue by assisting with the document.) .exhaustive()} {/* Primary Action Button */}
); }; export default TemplateDocumentReminder;