@tmlmobilidade/emails
Version:
16 lines (15 loc) • 776 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Text } from '@react-email/components';
import styles from './styles.js';
export function HighlightText({ as = 'span', children, size = 'normal', variant = 'highlight', }) {
// Override with variant-specific styles if not using 'small' size
const finalStyle = size === 'normal' ? styles.textStyles[variant] : {
...styles.textStyles.small,
...(variant !== 'highlight' && variant !== 'muted' ? { color: styles.colors[variant].text } : {}),
...(variant === 'muted' ? { color: styles.colors.muted.text } : {}),
};
if (as === 'span') {
return _jsx("span", { style: finalStyle, children: children });
}
return (_jsx(Text, { style: finalStyle, children: children }));
}