import { Card, CardContent } from '@/components/ui/Card'; import { TaskStats } from '@/lib/types'; import { useTheme } from '@/contexts/ThemeContext'; import { useJiraConfig } from '@/contexts/JiraConfigContext'; import { usePathname } from 'next/navigation'; import Link from 'next/link'; interface HeaderProps { title?: string; subtitle?: string; stats?: TaskStats; syncing?: boolean; } export function Header({ title = "TowerControl", subtitle = "Task Management", stats, syncing = false }: HeaderProps) { const { theme, toggleTheme } = useTheme(); const { isConfigured: isJiraConfigured, config: jiraConfig } = useJiraConfig(); const pathname = usePathname(); // Fonction pour déterminer si un lien est actif const isActiveLink = (href: string) => { if (href === '/') { return pathname === '/'; } return pathname.startsWith(href); }; // Fonction pour obtenir les classes CSS d'un lien const getLinkClasses = (href: string) => { const baseClasses = "font-mono text-sm uppercase tracking-wider transition-colors px-3 py-1.5 rounded-md"; if (isActiveLink(href)) { return `${baseClasses} text-[var(--primary)] bg-[var(--primary)]/10 border border-[var(--primary)]/30`; } return `${baseClasses} text-[var(--muted-foreground)] hover:text-[var(--primary)] hover:bg-[var(--card-hover)]`; }; return (
{/* Titre tech avec glow */}

{title}

{subtitle}

{/* Navigation */}
{/* Stats essentielles - seulement si stats disponibles */} {stats && (
)}
); } interface StatCardProps { label: string; value: number | string; color: 'blue' | 'green' | 'yellow' | 'gray' | 'purple'; } function StatCard({ label, value, color }: StatCardProps) { const textColors = { blue: 'text-[var(--primary)]', green: 'text-[var(--success)]', yellow: 'text-[var(--accent)]', gray: 'text-[var(--muted-foreground)]', purple: 'text-[var(--accent)]' }; return (
{label}
{value}
); }