// Scan screen — mock barcode scanner with viewfinder
function ScanScreen({ onDetect, onClose }) {
const T = window.T;
const { Icon } = window;
const codes = ['40821', '32207', '20618', '55031'];
return (
{/* fake camera view */}
{/* scan-line animation */}
{/* viewfinder corners */}
{[['tl', 0, 0, 'top', 'left'], ['tr', 0, 0, 'top', 'right'], ['bl', 0, 0, 'bottom', 'left'], ['br', 0, 0, 'bottom', 'right']].map(([k, , , y, x]) => (
))}
{/* header */}
{/* title */}
Apunta al código
del catálogo impreso
{/* suggestion pills */}
o toca para simular
{codes.map(c => (
))}
{/* torch button */}
);
}
// Bottom tab bar
function TabBar({ tab, onChange, hidden }) {
const T = window.T;
const { Icon } = window;
if (hidden) return null;
const tabs = [
{ key: 'home', label: 'Inicio', icon: 'home' },
{ key: 'orders', label: 'Pedidos', icon: 'list' },
{ key: 'pagos', label: 'Pagos', icon: 'doc' },
{ key: 'new', label: 'Nuevo', icon: 'plus' },
];
return (
{tabs.map(t => {
const active = tab === t.key;
const isNew = t.key === 'new';
return (
);
})}
);
}
Object.assign(window, { ScanScreen, TabBar });