adjust hitung karung page to match dashboard-cpsp
This commit is contained in:
1 parent
236c83ec3d
commit
b5ee6b87f0
1 file changed
+13
-3
@@ -62,7 +62,7 @@ const FeedSackCountingPage: React.FC<{ onSettings: () => void }> = ({ onSettings
|
||||
const currentDay = useMemo(() => {
|
||||
if (!selectedCycle) return 0;
|
||||
const rawDay = cycleDayForDate(selectedCycle.start_date, displayDate);
|
||||
return Math.min(rawDay, Math.max(0, selectedCycle.total_days - 1));
|
||||
return Math.min(rawDay, Math.max(0, (selectedCycle.total_days || 1) - 1));
|
||||
}, [selectedCycle, displayDate]);
|
||||
|
||||
const sortedCycles = useMemo(() => {
|
||||
@@ -101,8 +101,8 @@ const FeedSackCountingPage: React.FC<{ onSettings: () => void }> = ({ onSettings
|
||||
masuk: r.in_today,
|
||||
dituang: r.feed_use_today,
|
||||
keluar: r.out_today,
|
||||
masukManual: manual?.feed_in_manual ?? 0,
|
||||
dituangManual: manual?.feed_use_manual ?? 0,
|
||||
masukManual: manual?.feed_in_manual ?? null,
|
||||
dituangManual: manual?.feed_use_manual ?? null,
|
||||
};
|
||||
});
|
||||
return buildFeedSackInsightContext({
|
||||
@@ -161,6 +161,11 @@ const FeedSackCountingPage: React.FC<{ onSettings: () => void }> = ({ onSettings
|
||||
Aktif
|
||||
</span>
|
||||
)}
|
||||
{cycleStatus === 'pending_close' && (
|
||||
<span className="px-2 py-0.5 bg-amber-100 text-amber-700 text-xs font-medium rounded">
|
||||
Menunggu GM
|
||||
</span>
|
||||
)}
|
||||
{cycleStatus === 'closed' && (
|
||||
<span className="px-2 py-0.5 bg-gray-100 text-gray-600 text-xs font-medium rounded">
|
||||
Selesai
|
||||
@@ -201,6 +206,11 @@ const FeedSackCountingPage: React.FC<{ onSettings: () => void }> = ({ onSettings
|
||||
Aktif
|
||||
</span>
|
||||
)}
|
||||
{itemStatus === 'pending_close' && (
|
||||
<span className="px-2 py-0.5 bg-amber-100 text-amber-700 text-xs font-medium rounded">
|
||||
Menunggu GM
|
||||
</span>
|
||||
)}
|
||||
{itemStatus === 'closed' && (
|
||||
<span className="px-2 py-0.5 bg-gray-100 text-gray-600 text-xs font-medium rounded">
|
||||
Selesai
|
||||
|
||||
Reference in new issue
Block a user