/* ===== Item detail floating card ===== */ const ItemDetailCard = ({ item, anchor, onClose, onRotate, onLock, onRemove, violations }) => { if (!item) return null; const cat = window.Mojro.CATEGORIES.find(c => c.id === item.category); const top = (anchor?.y ?? 80) + 12; const left = Math.min(window.innerWidth - 360, (anchor?.x ?? 80) + 12); const myViols = (violations || []).filter(v => v.item === item.id); return (
#{item.id.toUpperCase()} {item.locked && }
{item.desc}
{item.sku}
{item.tag}}/> {cat?.name || '—'}}/> {item.qty}}/> {item.weight} kg}/> {item.L}×{item.W}×{item.H} mm}/> #{item.stop}}/>
Position · container coords
X 2.40 m Y 0.72 m Z 0.00 m
Constraints applied
{item.category==='fragile' && } {item.category==='hazmat' && } 1 ? '4' : '1'} layers`}/>
{myViols.length > 0 && (
{myViols.map(v => (
{v.rule}. {v.detail}
))}
)}
); }; const KvRow = ({ label, value }) => (
{label}
{value}
); const FlagRow = ({ ok, warn, text }) => (
{text}
); window.ItemDetailCard = ItemDetailCard;