This repository has been archived on 2026-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
Gishen-Email-Templates/emails/components/OrderSummary.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

79 lines
1.4 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 React from 'react';
import { Column, Row, Section, Text } from '@react-email/components';
import { theme } from '../theme';
import { Card } from './Card';
export interface OrderLineItem {
name: string;
qty: number;
price: string;
}
interface OrderSummaryProps {
orderId: string;
items: OrderLineItem[];
total: string;
orderLabel: string;
totalLabel: string;
}
export const OrderSummary = ({
orderId,
items,
total,
orderLabel,
totalLabel,
}: OrderSummaryProps) => (
<Card>
<Text style={label}>
{orderLabel}: {orderId}
</Text>
{items.map((item) => (
<Row key={`${item.name}-${item.qty}`} style={row}>
<Column>
<Text style={itemText}>
{item.name} × {item.qty}
</Text>
</Column>
<Column align="right">
<Text style={itemText}>{item.price}</Text>
</Column>
</Row>
))}
<Section style={totalRow}>
<Text style={totalText}>
{totalLabel}: {total}
</Text>
</Section>
</Card>
);
const label = {
color: theme.colors.muted,
fontSize: '13px',
margin: '0 0 12px',
};
const row = {
marginBottom: '6px',
};
const itemText = {
color: theme.colors.forest,
fontSize: '14px',
margin: 0,
};
const totalRow = {
borderTop: `1px solid ${theme.colors.line}`,
marginTop: '12px',
paddingTop: '12px',
};
const totalText = {
color: theme.colors.forest,
fontSize: '16px',
fontWeight: 700,
margin: 0,
};