- {/* Planned Time */}
-
-
- {!editTime && !updateDailyPlanLoading ? (
- <>
-
-
- {t('dailyPlan.PLANNED_TIME')} :{' '}
-
-
- {formatIntegerToHour(plan.workTimePlanned)}
-
-
- {(!checkPastDate(plan.date) || isTeamManager) && (
-
setEditTime(true)}
- />
- )}
- >
- ) : (
-
- setTime(parseFloat(e.target.value))}
- />
-
- {updateDailyPlanLoading ? (
-
- ) : (
- {
- updateDailyPlan({ workTimePlanned: time }, plan.id ?? '');
- setEditTime(false);
- }}
- />
- )}
-
-
- )}
-
-
- {/* Total estimated time based on tasks */}
-
-
-
- {t('dailyPlan.ESTIMATED_TIME')} :
-
- {formatIntegerToHour(estimatedTime / 3600)}
-
-
-
- {planMode !== 'Future Tasks' &&
}
-
- {/* Total worked time for the plan */}
- {planMode !== 'Future Tasks' && (
-
-
- {t('dailyPlan.TOTAL_TIME_WORKED')} :{' '}
-
-
- {formatIntegerToHour(totalWorkTime / 3600)}
-
-
- )}
-
- {planMode !== 'Future Tasks' &&
}
-
- {/* Completed tasks */}
- {planMode !== 'Future Tasks' && (
-
-
-
- {t('dailyPlan.COMPLETED_TASKS')} :{' '}
-
- {`${completedTasks}/${totalTasks}`}
-
-
- {t('dailyPlan.READY')}:
- {readyTasks}
-
-
- {t('dailyPlan.LEFT')}:
-
- {totalTasks - completedTasks - readyTasks}
-
-
-
- )}
-
-
-
- {/* Completion progress */}
- {planMode !== 'Future Tasks' && (
-
-
- {t('dailyPlan.COMPLETION')}:
- {completionPercent}%
-
-
-
- )}
-
- {/* Future tasks total plan */}
- {planMode === 'Future Tasks' && (
-
-
-
- {t('dailyPlan.PLANNED_TASKS')}:{' '}
-
- {totalTasks}
-
-
- )}
-
- );
+export function PlanHeader({ plan, planMode }: { plan: IDailyPlan; planMode: FilterTabs }) {
+ const [editTime, setEditTime] = useState