feat: adding status archived and refacto type in one place only

This commit is contained in:
Julien Froidefond
2025-09-15 10:24:49 +02:00
parent 05cd099cf4
commit 363e739b5c
7 changed files with 42 additions and 52 deletions

View File

@@ -3,19 +3,11 @@
import { KanbanBoardContainer } from '@/components/kanban/BoardContainer';
import { Header } from '@/components/ui/Header';
import { TasksProvider, useTasksContext } from '@/contexts/TasksContext';
import { Task, Tag } from '@/lib/types';
import { Task, Tag, TaskStats } from '@/lib/types';
interface HomePageClientProps {
initialTasks: Task[];
initialStats: {
total: number;
completed: number;
inProgress: number;
todo: number;
cancelled: number;
freeze: number;
completionRate: number;
};
initialStats: TaskStats;
initialTags: (Tag & { usage: number })[];
}

View File

@@ -1,18 +1,11 @@
import { Card, CardContent } from '@/components/ui/Card';
import { TaskStats } from '@/lib/types';
import Link from 'next/link';
interface HeaderProps {
title: string;
subtitle: string;
stats: {
total: number;
completed: number;
inProgress: number;
todo: number;
cancelled: number;
freeze: number;
completionRate: number;
};
stats: TaskStats;
syncing?: boolean;
}
@@ -98,6 +91,13 @@ export function Header({ title, subtitle, stats, syncing = false }: HeaderProps)
color="gray"
/>
)}
{stats.archived > 0 && (
<StatCard
label="ARCHIVE"
value={String(stats.archived).padStart(2, '0')}
color="gray"
/>
)}
<StatCard
label="RATE"
value={`${stats.completionRate}%`}