import React from 'react'; import { FeedSackLogEntry } from '../../types.ts'; const BoundingBox: React.FC<{ top: string; left: string; width: string; height: string; delay: string; color: string; }> = ({ top, left, width, height, delay, color }) => (
); interface LiveFeedViewProps { mode: 'inbound' | 'usage'; latestLog?: FeedSackLogEntry; } const LiveFeedView: React.FC = ({ mode, latestLog }) => { const config = { inbound: { title: 'Kamera Pintu Masuk Gudang', image: 'https://i.imgur.com/rLd7gP9.jpg', // Warehouse entrance color: '#22c55e', // green-500 textColor: 'text-green-400', boxes: [ { top: '40%', left: '55%', width: '12%', height: '25%', delay: '0s' }, { top: '42%', left: '40%', width: '12%', height: '26%', delay: '0.2s' }, { top: '45%', left: '25%', width: '12%', height: '24%', delay: '0.4s' }, ], }, usage: { title: 'Kamera Area Feeder', image: 'https://i.imgur.com/8p8Yq3g.jpg', // Coop interior color: '#f97316', // orange-500 textColor: 'text-orange-400', boxes: [{ top: '60%', left: '20%', width: '15%', height: '28%', delay: '0.1s' }], }, }; const currentConfig = config[mode]; const count = latestLog ? latestLog.count : 0; return (

{currentConfig.title}

LIVE
Live camera feed {currentConfig.boxes.map((box, i) => ( ))}

Terdeteksi:{' '} {count} karung

Lokasi: {latestLog?.location || 'N/A'}

); }; export default LiveFeedView;