Blame view

美国版/Food Labeling Management Platform/src/components/layout/Header.tsx 2.19 KB
884054fb   “wangming”   项目初始化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  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: 90 }}>
        <div>
          <h1 className="text-2xl font-bold" style={{ color: 'rgb(43, 50, 143)' }}>{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="flex items-center w-64 h-9 rounded-md border border-gray-200 bg-gray-50 focus-within:bg-white focus-within:ring-2 focus-within:ring-ring/50 focus-within:border-ring transition-colors overflow-hidden">
            <Search className="h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none" />
            <Input
              type="search"
              placeholder="Search..."
              className="flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full"
            />
          </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>
    );
  }