Gishen-Email-Template/emails/dispatch-assigned.tsx
Kirubel-Kibru-Yaltopia f9fa3bc83b feat: add Gishen React Email demo with en/am templates
Ship 23 transactional templates, shared brand tokens/logo, preview UI,
render API, CHANGELOG, and docs for Ecom/Admin/B2B consumers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 22:12:21 +03:00

47 lines
1.7 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Heading, Section, Text } from '@react-email/components';
import { EmailLayout } from './components/EmailLayout';
import { Button } from './components/Button';
import { StatusBanner } from './components/StatusBanner';
import { styles } from './components/styles';
import { tCommon } from './i18n/common';
import { tTemplate } from './i18n/templates';
import { resolveLocale, type Locale } from './i18n/types';
import { interpolate } from './utils/interpolate';
import { theme } from './theme';
export interface DispatchAssignedEmailProps {
locale?: Locale;
orderId?: string;
riderName?: string;
branchName?: string;
pickupWindow?: string;
ctaUrl?: string;
}
export const DispatchAssignedEmail = ({
locale,
orderId = 'GS-10482',
riderName = 'Dawit Lemma',
branchName = 'Bole Branch',
pickupWindow = '16:00–16:30',
ctaUrl = `${theme.brand.website}/admin/dispatch`,
}: DispatchAssignedEmailProps) => {
const l = resolveLocale(locale);
const t = tTemplate('dispatch-assigned', l);
const common = tCommon(l);
return (
<EmailLayout preview={interpolate(t.preview, { orderId })} locale={l}>
<StatusBanner tone="brand">{interpolate(t.banner, { pickupWindow })}</StatusBanner>
<Heading style={styles.heading}>{t.heading}</Heading>
<Text style={styles.text}>{interpolate(t.body1, { orderId, riderName, branchName })}</Text>
<Section style={styles.buttonSection}>
<Button href={ctaUrl}>{t.cta}</Button>
</Section>
<Text style={styles.muted}>{common.regards}<br />{common.team}</Text>
</EmailLayout>
);
};
DispatchAssignedEmail.PreviewProps = { locale: 'en' } as DispatchAssignedEmailProps;
export default DispatchAssignedEmail;