'use client'; import Link from 'next/link'; import * as Icons from 'lucide-react'; import { getAllModules } from '@/core/module-registry'; import { useFeatureFlag } from '@/core/feature-flags'; import { useI18n } from '@/core/i18n'; import { EXTERNAL_TOOLS } from '@/config/external-tools'; import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '@/shared/components/ui/card'; import { Badge } from '@/shared/components/ui/badge'; function DynamicIcon({ name, className }: { name: string; className?: string }) { const pascalName = name.replace(/(^|-)([a-z])/g, (_, _p, c: string) => c.toUpperCase()); const IconComponent = (Icons as unknown as Record>)[pascalName]; if (!IconComponent) return ; return ; } function ModuleCard({ module }: { module: { id: string; name: string; description: string; icon: string; route: string; featureFlag: string } }) { const enabled = useFeatureFlag(module.featureFlag); if (!enabled) return null; return (
{module.name} {module.description}
); } const CATEGORY_LABELS: Record = { dev: 'Dezvoltare', tools: 'Instrumente', monitoring: 'Monitorizare', security: 'Securitate', }; export default function DashboardPage() { const { t } = useI18n(); const modules = getAllModules(); const toolCategories = Object.keys(CATEGORY_LABELS).filter( (cat) => EXTERNAL_TOOLS.some((tool) => tool.category === cat) ); return (

{t('dashboard.welcome')}

{t('dashboard.subtitle')}

{/* Quick stats */}

Module active

{modules.length}

Companii

3

Instrumente externe

{EXTERNAL_TOOLS.length}

Stocare

localStorage

{/* Modules grid */}

{t('dashboard.modules')}

{modules.map((m) => ( ))}
{/* External tools */}

Instrumente externe

{toolCategories.map((cat) => (
{CATEGORY_LABELS[cat]}
{EXTERNAL_TOOLS.filter((tool) => tool.category === cat).map((tool) => { const cardContent = (

{tool.name}

{tool.description}

); if (!tool.url) return cardContent; return ( {cardContent} ); })}
))}
); }