import React from 'react'; import { formatNumber } from '../../utils/format.ts'; interface InitialBalanceComparisonProps { date: string; manual: number; iot: number | null; accuracy: number | null; syncError?: string | null; loading?: boolean; } const InitialBalanceComparison: React.FC = ({ date, manual, iot, accuracy, syncError = null, loading = false, }) => { const accuracyLabel = accuracy == null ? 'N/A' : `${formatNumber(accuracy, 1)}%`; const accuracyColor = accuracy == null ? 'text-gray-500' : accuracy >= 95 ? 'text-green-600' : accuracy >= 80 ? 'text-yellow-600' : 'text-red-600'; return (

Perbandingan {date} {loading ? ' ยท memuat...' : ''}

Manual

{formatNumber(manual)} karung

IOT

{iot == null ? 'N/A' : `${formatNumber(iot)} karung`}

Akurasi

{accuracyLabel}

{syncError && (

Sinkron IoT di site: {syncError}

)}
); }; export default InitialBalanceComparison;