feat: update dashboard and project components for batch handling and icon management

This commit is contained in:
Kemas M. Aryadary Rasyad
2026-07-09 17:39:46 +07:00
parent 328bcbcdc2
commit 88f457258d
8 changed files with 198 additions and 177 deletions
@@ -1,17 +1,10 @@
import { useNavigate } from 'react-router-dom';
import * as LucideIcons from 'lucide-react';
import type { LucideProps } from 'lucide-react';
import { getProjectIcon } from '../../../../lib/ProjectIcons';
import type { Project } from '../../../../types/project.types';
const getDynamicIcon = (iconName: string) => {
const formatted = iconName.charAt(0).toUpperCase() + iconName.slice(1);
const Icon = (LucideIcons as unknown as Record<string, React.ComponentType<LucideProps>>)[formatted];
return Icon ?? LucideIcons.FolderOpen;
};
const ProjectCard = (project: Project) => {
const navigate = useNavigate();
const Icon = getDynamicIcon(project.project_icon);
const Icon = getProjectIcon(project.project_icon);
const tasksDone = project.task_done;