TypeScript · 2493 bytes Raw Blame History
1 import Link from 'next/link';
2
3 interface BreadcrumbItem {
4 label: string;
5 href?: string;
6 }
7
8 interface HeaderProps {
9 breadcrumbs: BreadcrumbItem[];
10 showSearch?: boolean;
11 showIndex?: boolean;
12 showAwards?: boolean;
13 }
14
15 export default function Header({ breadcrumbs, showSearch = true, showIndex = true, showAwards = true }: HeaderProps) {
16 return (
17 <header className="bg-[#AE122A] shadow-lg">
18 <div className="max-w-6xl mx-auto px-4 py-6">
19 <div className="flex justify-between items-center">
20 {/* Breadcrumb Navigation */}
21 <nav className="flex items-center space-x-3 text-white flex-wrap">
22 {breadcrumbs.map((item, index) => (
23 <div key={index} className="flex items-center">
24 {item.href ? (
25 <Link
26 href={item.href}
27 className="text-[#FFD619] hover:text-white transition-colors"
28 >
29 {item.label}
30 </Link>
31 ) : (
32 <span className="font-semibold">{item.label}</span>
33 )}
34 {index < breadcrumbs.length - 1 && (
35 <span className="text-[#FFD619] ml-3"></span>
36 )}
37 </div>
38 ))}
39 </nav>
40
41 {/* Right Navigation */}
42 {(showSearch || showIndex || showAwards) && (
43 <div className="flex items-center space-x-4">
44 {showSearch && (
45 <Link
46 href="/memorial/search"
47 className="text-[#FFD619] hover:text-white transition-colors font-semibold"
48 >
49 Search Memorial
50 </Link>
51 )}
52 {showAwards && (
53 <Link
54 href="/awards"
55 className="bg-[#FFD619] text-[#AE122A] px-4 py-2 rounded font-bold hover:bg-white transition-colors shadow-md text-center text-sm leading-tight"
56 >
57 Awards for<br />Heroism &amp; Gallantry
58 </Link>
59 )}
60 {showIndex && (
61 <Link
62 href="/memorial"
63 className="bg-[#FFD619] text-[#AE122A] px-6 py-2 rounded font-bold hover:bg-white transition-colors shadow-md"
64 >
65 View Complete Index
66 </Link>
67 )}
68 </div>
69 )}
70 </div>
71 </div>
72 </header>
73 );
74 }