// widgets.jsx — hibank Design System tokens function StatCard({ label, value, sub, change, up, color, icon, primary }) { const SUCCESS = '#74b50c'; const DANGER = '#ed3151'; const TEAL = primary || '#0056D2'; return (
{label}
{value}
{change} {sub}
); } function TxRow({ id, name, type, amount, time, status, primary }) { const isPos = amount.startsWith('+'); const TEAL = primary || '#0056D2'; const s = status === 'success' ? { bg: 'rgba(116,181,12,0.10)', color: '#74b50c', label: 'Berhasil' } : status === 'pending' ? { bg: 'rgba(251,211,48,0.18)', color: '#a18200', label: 'Pending' } : { bg: 'rgba(237,49,81,0.10)', color: '#ed3151', label: 'Gagal' }; return (
{name[0]}
{name}
{id} · {type}
{amount}
{time}
{s.label}
); } function BarChart({ data, labels, color }) { const max = Math.max(...data); return (
{data.map((v, i) => (
{labels[i]}
))}
); } Object.assign(window, { StatCard, TxRow, BarChart });