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(() => {
|
const currentDay = useMemo(() => {
|
||||||
if (!selectedCycle) return 0;
|
if (!selectedCycle) return 0;
|
||||||
const rawDay = cycleDayForDate(selectedCycle.start_date, displayDate);
|
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]);
|
}, [selectedCycle, displayDate]);
|
||||||
|
|
||||||
const sortedCycles = useMemo(() => {
|
const sortedCycles = useMemo(() => {
|
||||||
@@ -101,8 +101,8 @@ const FeedSackCountingPage: React.FC<{ onSettings: () => void }> = ({ onSettings
|
|||||||
masuk: r.in_today,
|
masuk: r.in_today,
|
||||||
dituang: r.feed_use_today,
|
dituang: r.feed_use_today,
|
||||||
keluar: r.out_today,
|
keluar: r.out_today,
|
||||||
masukManual: manual?.feed_in_manual ?? 0,
|
masukManual: manual?.feed_in_manual ?? null,
|
||||||
dituangManual: manual?.feed_use_manual ?? 0,
|
dituangManual: manual?.feed_use_manual ?? null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return buildFeedSackInsightContext({
|
return buildFeedSackInsightContext({
|
||||||
@@ -161,6 +161,11 @@ const FeedSackCountingPage: React.FC<{ onSettings: () => void }> = ({ onSettings
|
|||||||
Aktif
|
Aktif
|
||||||
</span>
|
</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' && (
|
{cycleStatus === 'closed' && (
|
||||||
<span className="px-2 py-0.5 bg-gray-100 text-gray-600 text-xs font-medium rounded">
|
<span className="px-2 py-0.5 bg-gray-100 text-gray-600 text-xs font-medium rounded">
|
||||||
Selesai
|
Selesai
|
||||||
@@ -201,6 +206,11 @@ const FeedSackCountingPage: React.FC<{ onSettings: () => void }> = ({ onSettings
|
|||||||
Aktif
|
Aktif
|
||||||
</span>
|
</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' && (
|
{itemStatus === 'closed' && (
|
||||||
<span className="px-2 py-0.5 bg-gray-100 text-gray-600 text-xs font-medium rounded">
|
<span className="px-2 py-0.5 bg-gray-100 text-gray-600 text-xs font-medium rounded">
|
||||||
Selesai
|
Selesai
|
||||||
|
|||||||
Reference in new issue
Block a user