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 LowStockEmailProps { locale?: Locale; skuCode?: string; skuName?: string; branchName?: string; quantity?: string; threshold?: string; ctaUrl?: string; } export const LowStockEmail = ({ locale, skuCode = 'MED-AMOX-500', skuName = 'Amoxicillin 500mg', branchName = 'Bole Branch', quantity = '8', threshold = '25', ctaUrl = `${theme.brand.website}/admin/stock`, }: LowStockEmailProps) => { const l = resolveLocale(locale); const t = tTemplate('low-stock', l); const common = tCommon(l); return ( {t.banner} {t.heading} {interpolate(t.body1, { skuCode, skuName, branchName, quantity, threshold })}
{common.regards}
{common.team}
); }; LowStockEmail.PreviewProps = { locale: 'en' } as LowStockEmailProps; export default LowStockEmail;