@@ -2,6 +2,36 @@ import { Link } from "react-router-dom";
2
2
import { SidebarTrigger } from "./ui/sidebar" ;
3
3
import { Separator } from "./ui/separator" ;
4
4
5
+ function HeaderMenuItem ( { children } : { children : React . ReactNode } ) {
6
+ return (
7
+ < div className = "text-black hover:text-gray-800 font-semibold cursor-pointer text-base px-2 py-1 rounded-md hover:bg-blue-50 transition-colors" >
8
+ { children }
9
+ </ div >
10
+ ) ;
11
+ }
12
+
13
+ function DropdownMenu ( { children } : { children : React . ReactNode } ) {
14
+ return (
15
+ < div className = "absolute right-0 top-full mt-2 w-56 bg-white rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 border border-gray-100" >
16
+ < div className = "py-1" > { children } </ div >
17
+ </ div >
18
+ ) ;
19
+ }
20
+
21
+ function DropdownMenuItem ( {
22
+ children,
23
+ to,
24
+ } : {
25
+ to : string ;
26
+ children : React . ReactNode ;
27
+ } ) {
28
+ return (
29
+ < Link to = { to } className = "block px-5 py-3 text-gray-700 hover:bg-blue-50" >
30
+ { children }
31
+ </ Link >
32
+ ) ;
33
+ }
34
+
5
35
export function Header ( { hasError } : { hasError ?: boolean } ) {
6
36
return (
7
37
< header className = "flex-shrink-0 h-16 px-3 items-center flex w-full bg-teal-25 opacity-1 border-b-blue-200 border-b" >
@@ -23,46 +53,25 @@ export function Header({ hasError }: { hasError?: boolean }) {
23
53
</ div >
24
54
< div className = "flex items-center gap-4 mr-16" >
25
55
< div className = "flex items-center relative group" >
26
- < div className = "text-black hover:text-gray-800 font-semibold cursor-pointer text-base px-2 py-1 rounded-md hover:bg-blue-50 transition-colors" >
27
- Certificates
28
- </ div >
29
- < div className = "absolute right-0 top-full mt-2 w-56 bg-white rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 border border-gray-100" >
30
- < div className = "py-1" >
31
- < Link
32
- to = "/certificates"
33
- className = "block px-5 py-3 text-gray-700 hover:bg-blue-50"
34
- >
35
- Download
36
- </ Link >
37
- < Link
38
- to = "/certificates/security"
39
- className = "block px-5 py-3 text-gray-700 hover:bg-blue-50"
40
- >
41
- Certificate Security
42
- </ Link >
43
- </ div >
44
- </ div >
56
+ < HeaderMenuItem > Certificates</ HeaderMenuItem >
57
+ < DropdownMenu >
58
+ < DropdownMenuItem to = "/certificates" > Download</ DropdownMenuItem >
59
+ < DropdownMenuItem to = "/certificates/security" >
60
+ Certificate Security
61
+ </ DropdownMenuItem >
62
+ </ DropdownMenu >
45
63
</ div >
64
+
46
65
< div className = "flex items-center relative group" >
47
- < div className = "text-black hover:text-gray-800 font-semibold cursor-pointer text-base px-2 py-1 rounded-md hover:bg-blue-50 transition-colors" >
48
- Help
49
- </ div >
50
- < div className = "absolute right-0 top-full mt-2 w-56 bg-white rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 border border-gray-100" >
51
- < div className = "py-1" >
52
- < Link
53
- to = "/help/continue-setup"
54
- className = "block px-5 py-3 text-gray-700 hover:bg-blue-50"
55
- >
56
- Continue Setup
57
- </ Link >
58
- < Link
59
- to = "/help/copilot-setup"
60
- className = "block px-5 py-3 text-gray-700 hover:bg-blue-50"
61
- >
62
- Copilot Setup
63
- </ Link >
64
- </ div >
65
- </ div >
66
+ < HeaderMenuItem > Help</ HeaderMenuItem >
67
+ < DropdownMenu >
68
+ < DropdownMenuItem to = "/help/continue-setup" >
69
+ Continue Setup
70
+ </ DropdownMenuItem >
71
+ < DropdownMenuItem to = "/help/copilot-setup" >
72
+ Copilot Setup
73
+ </ DropdownMenuItem >
74
+ </ DropdownMenu >
66
75
</ div >
67
76
68
77
< div className = "flex items-center relative group" >
0 commit comments