Header.tsx 1.99 KB
import React from 'react';
import { Search, Settings, Calendar, Bell } from 'lucide-react';
import { Input } from '../ui/input';
import { Button } from '../ui/button';
import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar';

interface HeaderProps {
  title: string;
}

export function Header({ title }: HeaderProps) {
  const currentDate = new Date().toLocaleDateString('en-US', { 
    year: 'numeric', 
    month: 'long', 
    day: 'numeric' 
  });

  return (
    <header className="bg-white border-b border-gray-200 px-8 flex items-center justify-between shadow-sm sticky top-0 z-10 shrink-0" style={{ height: 'var(--header-bar-height, 90px)' }}>
      <div>
        <h1 className="text-2xl font-bold" style={{ color: '#2b328f' }}>{title} Overview</h1>
        <p className="text-sm text-gray-500 mt-1 flex items-center gap-2">
          {currentDate} | Last updated: Just now
        </p>
      </div>

      <div className="flex items-center gap-4">
        <div className="relative w-64">
          <Search className="absolute left-2.5 top-2.5 h-4 w-4 text-gray-400" />
          <Input 
            type="search" 
            placeholder="Search..." 
            className="pl-9 bg-gray-50 border-gray-200 focus:bg-white transition-colors"
          />
        </div>
        
        <Button variant="ghost" size="icon" className="text-gray-500 hover:text-gray-700">
          <Settings className="w-5 h-5" />
        </Button>
        
        <div className="h-8 w-px bg-gray-200 mx-2" />
        
        <div className="flex items-center gap-3">
          <div className="text-right hidden md:block">
            <div className="text-sm font-medium text-gray-900">Admin User</div>
            <div className="text-xs text-gray-500">Administrator</div>
          </div>
          <Avatar className="h-10 w-10 border border-gray-200">
            <AvatarImage src="https://github.com/shadcn.png" />
            <AvatarFallback>AD</AvatarFallback>
          </Avatar>
        </div>
      </div>
    </header>
  );
}