feat: add cancelled and freeze stats to Header component
- Introduced `cancelled` and `freeze` properties to `HeaderProps` for enhanced task tracking. - Updated rendering logic to conditionally display `StatCard` components for `FREEZE` and `CANCEL` statuses based on their values, improving user feedback on task distribution.
This commit is contained in:
@@ -9,6 +9,8 @@ interface HeaderProps {
|
||||
completed: number;
|
||||
inProgress: number;
|
||||
todo: number;
|
||||
cancelled: number;
|
||||
freeze: number;
|
||||
completionRate: number;
|
||||
};
|
||||
syncing?: boolean;
|
||||
@@ -61,21 +63,41 @@ export function Header({ title, subtitle, stats, syncing = false }: HeaderProps)
|
||||
value={String(stats.total).padStart(2, '0')}
|
||||
color="blue"
|
||||
/>
|
||||
<StatCard
|
||||
label="DONE"
|
||||
value={String(stats.completed).padStart(2, '0')}
|
||||
color="green"
|
||||
/>
|
||||
<StatCard
|
||||
label="ACTIVE"
|
||||
value={String(stats.inProgress).padStart(2, '0')}
|
||||
color="yellow"
|
||||
/>
|
||||
<StatCard
|
||||
label="QUEUE"
|
||||
value={String(stats.todo).padStart(2, '0')}
|
||||
color="gray"
|
||||
/>
|
||||
{stats.completed > 0 && (
|
||||
<StatCard
|
||||
label="DONE"
|
||||
value={String(stats.completed).padStart(2, '0')}
|
||||
color="green"
|
||||
/>
|
||||
)}
|
||||
{stats.inProgress > 0 && (
|
||||
<StatCard
|
||||
label="ACTIVE"
|
||||
value={String(stats.inProgress).padStart(2, '0')}
|
||||
color="yellow"
|
||||
/>
|
||||
)}
|
||||
{stats.todo > 0 && (
|
||||
<StatCard
|
||||
label="QUEUE"
|
||||
value={String(stats.todo).padStart(2, '0')}
|
||||
color="gray"
|
||||
/>
|
||||
)}
|
||||
{stats.freeze > 0 && (
|
||||
<StatCard
|
||||
label="FREEZE"
|
||||
value={String(stats.freeze).padStart(2, '0')}
|
||||
color="blue"
|
||||
/>
|
||||
)}
|
||||
{stats.cancelled > 0 && (
|
||||
<StatCard
|
||||
label="CANCEL"
|
||||
value={String(stats.cancelled).padStart(2, '0')}
|
||||
color="gray"
|
||||
/>
|
||||
)}
|
||||
<StatCard
|
||||
label="RATE"
|
||||
value={`${stats.completionRate}%`}
|
||||
|
||||
Reference in New Issue
Block a user