@@ -2,6 +2,11 @@ import { useMemo } from "react";
22import { priorityConfig } from "@/config/taskConfig" ;
33import type { Task } from "@/types/tasks-system/task" ;
44import { useTranslation } from "react-i18next" ;
5+ import { TaskStatusColors , TaskPriorityColors } from "@/types/tasks-system/task" ;
6+
7+ // Usa los colores importados
8+ const PRIORITY_COLORS = TaskPriorityColors ;
9+ const STATUS_COLORS = TaskStatusColors ;
510
611// Helper para obtener inicio de semana
712function getStartOfWeek ( ) : Date {
@@ -20,20 +25,6 @@ function parseDate(value?: string): Date | null {
2025 return Number . isNaN ( d . getTime ( ) ) ? null : d ;
2126}
2227
23- // Colores de gráficos
24- const PRIORITY_COLORS = {
25- Baja : "#1d4ed8" , // blue-700
26- Media : "#a16207" , // yellow-700
27- Alta : "#c2410c" , // orange-700
28- Urgente : "#b91c1c" , // red-700
29- } as const ;
30-
31- const STATUS_COLORS = {
32- pending : "#374151" , // gray-700
33- inProgress : "#1d4ed8" , // blue-700
34- completed : "#15803d" , // green-700
35- } as const ;
36-
3728interface UseDashboardChartsProps {
3829 accessibleTasks : Task [ ] ;
3930 accessibleLists ?: Array < { id : string ; name : string } > ;
@@ -184,17 +175,17 @@ export function useDashboardCharts({
184175 {
185176 name : t ( "dashboard.statusLabels.pending" ) ,
186177 value : taskStats . pending ,
187- fill : STATUS_COLORS . pending ,
178+ fill : STATUS_COLORS . PENDING ,
188179 } ,
189180 {
190181 name : t ( "dashboard.statusLabels.inProgress" ) ,
191182 value : taskStats . inProgress ,
192- fill : STATUS_COLORS . inProgress ,
183+ fill : STATUS_COLORS . IN_PROGRESS ,
193184 } ,
194185 {
195186 name : t ( "dashboard.statusLabels.completed" ) ,
196187 value : taskStats . completed ,
197- fill : STATUS_COLORS . completed ,
188+ fill : STATUS_COLORS . COMPLETED ,
198189 } ,
199190 ] . filter ( ( item ) => item . value > 0 ) ;
200191 } , [ taskStats , t ] ) ;
@@ -203,15 +194,15 @@ export function useDashboardCharts({
203194 ( ) => ( {
204195 [ t ( "dashboard.statusLabels.pending" ) ] : {
205196 label : t ( "dashboard.statusLabels.pending" ) ,
206- color : STATUS_COLORS . pending ,
197+ color : STATUS_COLORS . PENDING ,
207198 } ,
208199 [ t ( "dashboard.statusLabels.inProgress" ) ] : {
209200 label : t ( "dashboard.statusLabels.inProgress" ) ,
210- color : STATUS_COLORS . inProgress ,
201+ color : STATUS_COLORS . IN_PROGRESS ,
211202 } ,
212203 [ t ( "dashboard.statusLabels.completed" ) ] : {
213204 label : t ( "dashboard.statusLabels.completed" ) ,
214- color : STATUS_COLORS . completed ,
205+ color : STATUS_COLORS . COMPLETED ,
215206 } ,
216207 } ) ,
217208 [ t ] ,
@@ -273,15 +264,15 @@ export function useDashboardCharts({
273264 ( ) => ( {
274265 pending : {
275266 label : t ( "dashboard.statusLabels.pending" ) ,
276- color : STATUS_COLORS . pending ,
267+ color : STATUS_COLORS . PENDING ,
277268 } ,
278269 inProgress : {
279270 label : t ( "dashboard.statusLabels.inProgress" ) ,
280- color : STATUS_COLORS . inProgress ,
271+ color : STATUS_COLORS . IN_PROGRESS ,
281272 } ,
282273 completed : {
283274 label : t ( "dashboard.statusLabels.completed" ) ,
284- color : STATUS_COLORS . completed ,
275+ color : STATUS_COLORS . COMPLETED ,
285276 } ,
286277 } ) ,
287278 [ t ] ,
0 commit comments