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

@@ -4,7 +4,7 @@ import { createContext, useContext, ReactNode, useState, useMemo, useEffect } fr
import { useTasks } from '@/hooks/useTasks';
import { useTags } from '@/hooks/useTags';
import { userPreferencesService } from '@/services/user-preferences';
import { Task, Tag } from '@/lib/types';
import { Task, Tag, TaskStats } from '@/lib/types';
import { CreateTaskData, UpdateTaskData, TaskFilters } from '@/clients/tasks-client';
import { KanbanFilters } from '@/components/kanban/KanbanFilters';
import { sortTasks, getSortOption, DEFAULT_SORT, createSortKey } from '@/lib/sort-config';
@@ -12,15 +12,7 @@ import { sortTasks, getSortOption, DEFAULT_SORT, createSortKey } from '@/lib/sor
interface TasksContextType {
tasks: Task[]; // Toutes les tâches
regularTasks: Task[]; // Tâches sans les épinglées (pour Kanban)
stats: {
total: number;
completed: number;
inProgress: number;
todo: number;
cancelled: number;
freeze: number;
completionRate: number;
};
stats: TaskStats;
loading: boolean;
syncing: boolean;
error: string | null;
@@ -46,7 +38,7 @@ const TasksContext = createContext<TasksContextType | null>(null);
interface TasksProviderProps {
children: ReactNode;
initialTasks: Task[];
initialStats: TasksContextType['stats'];
initialStats: TaskStats;
initialTags?: (Tag & { usage: number })[];
}