fix initial balance logic and add edit for cycle data

This commit is contained in:
Alberto-Audrix committed 2026-09-01 14:59:47 +07:00
1 parent 7a9d600aa6
commit 697feb206c
15 files changed
+402 -93

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
import React, { useEffect, useRef, useState } from 'react';
import { useAuth } from '../context/AuthContext.tsx';
import { useFarm } from '../context/FarmContext.tsx';
import { formatDateId } from '../utils/format.ts';
import { formatDateId, resolveCycleStatus } from '../utils/format.ts';
type HeaderProps = {
onToggleSidebar: () => void;
@@ -93,7 +93,7 @@ const Header: React.FC<HeaderProps> = ({
{cycles.map((cycle) => (
<option key={cycle.id} value={cycle.id}>
{formatDateId(cycle.start_date)} (
{cycle.status === 'active' ? 'Aktif' : 'Selesai'})
{resolveCycleStatus(cycle) === 'active' ? 'Aktif' : 'Selesai'})
</option>
))}
</select>