2025-12-11 10:50:09 +00:00
|
|
|
"use client";
|
|
|
|
|
|
2026-01-31 13:50:07 +00:00
|
|
|
import { Search, LayoutGrid, List, Plus } from 'lucide-react';
|
|
|
|
|
import { Button } from '@/components/ui/button';
|
2025-12-11 10:50:09 +00:00
|
|
|
|
|
|
|
|
interface DashboardHeaderProps {
|
|
|
|
|
searchTerm: string;
|
|
|
|
|
onSearchChange: (value: string) => void;
|
|
|
|
|
viewMode: 'grid' | 'list';
|
|
|
|
|
onViewModeChange: (mode: 'grid' | 'list') => void;
|
2026-01-31 13:50:07 +00:00
|
|
|
onCreateProject?: () => void;
|
2025-12-11 10:50:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function DashboardHeader({
|
|
|
|
|
searchTerm,
|
|
|
|
|
onSearchChange,
|
|
|
|
|
viewMode,
|
2026-01-31 13:50:07 +00:00
|
|
|
onViewModeChange,
|
|
|
|
|
onCreateProject
|
2025-12-11 10:50:09 +00:00
|
|
|
}: DashboardHeaderProps) {
|
|
|
|
|
return (
|
2026-05-07 15:52:12 +00:00
|
|
|
<header className="header-gradient border-b">
|
2026-01-31 12:56:51 +00:00
|
|
|
<div className="px-4 sm:px-6 lg:px-8 py-4">
|
2025-12-11 10:50:09 +00:00
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div>
|
2026-01-31 12:56:51 +00:00
|
|
|
<h1 className="text-2xl font-semibold text-foreground">Dashboard de Proyectos</h1>
|
|
|
|
|
<p className="text-sm text-muted-foreground mt-1">Gestiona y visualiza todos tus proyectos</p>
|
2025-12-11 10:50:09 +00:00
|
|
|
</div>
|
|
|
|
|
<div className="flex items-center gap-3">
|
|
|
|
|
<div className="relative">
|
2026-01-31 12:56:51 +00:00
|
|
|
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" />
|
2025-12-11 10:50:09 +00:00
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder="Buscar proyectos..."
|
|
|
|
|
value={searchTerm}
|
|
|
|
|
onChange={(e) => onSearchChange(e.target.value)}
|
2026-01-31 12:56:51 +00:00
|
|
|
className="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent w-64 text-sm bg-background text-foreground"
|
2025-12-11 10:50:09 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2026-01-31 12:56:51 +00:00
|
|
|
<div className="flex gap-1 border rounded-lg p-1">
|
2025-12-11 10:50:09 +00:00
|
|
|
<button
|
|
|
|
|
onClick={() => onViewModeChange('grid')}
|
2026-01-31 12:56:51 +00:00
|
|
|
className={`p-2 rounded ${viewMode === 'grid' ? 'bg-muted' : 'hover:bg-muted/50'}`}
|
2025-12-11 10:50:09 +00:00
|
|
|
>
|
2026-01-31 12:56:51 +00:00
|
|
|
<LayoutGrid className="w-4 h-4 text-muted-foreground" />
|
2025-12-11 10:50:09 +00:00
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => onViewModeChange('list')}
|
2026-01-31 12:56:51 +00:00
|
|
|
className={`p-2 rounded ${viewMode === 'list' ? 'bg-muted' : 'hover:bg-muted/50'}`}
|
2025-12-11 10:50:09 +00:00
|
|
|
>
|
2026-01-31 12:56:51 +00:00
|
|
|
<List className="w-4 h-4 text-muted-foreground" />
|
2025-12-11 10:50:09 +00:00
|
|
|
</button>
|
|
|
|
|
</div>
|
2026-01-31 13:50:07 +00:00
|
|
|
{onCreateProject && (
|
|
|
|
|
<Button onClick={onCreateProject} size="sm">
|
|
|
|
|
<Plus className="w-4 h-4 mr-2" />
|
|
|
|
|
Nuevo proyecto
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
2025-12-11 10:50:09 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
);
|
2026-05-07 15:52:12 +00:00
|
|
|
}
|