11import { Link } from "react-router-dom" ;
22import { SidebarTrigger } from "./ui/sidebar" ;
3- import { HoverPopover } from "./HoverPopover" ;
4- import { Separator , ButtonDarkMode , MenuItem } from "@stacklok/ui-kit" ;
3+ import { DropdownMenu } from "./HoverPopover" ;
4+ import { Separator , ButtonDarkMode , OptionsSchema } from "@stacklok/ui-kit" ;
55import { WorkspacesSelection } from "@/features/workspace/components/workspaces-selection" ;
66import { BookOpenText , Download , ShieldCheck } from "lucide-react" ;
77import { Continue , Copilot , Discord , Github , Youtube } from "./icons" ;
88
9+ const CERTIFICATE_MENU_ITEMS : OptionsSchema < "menu" > [ ] = [
10+ {
11+ icon : < ShieldCheck /> ,
12+ id : "about-certificate-security" ,
13+ href : "/certificates/security" ,
14+ textValue : "About certificate security" ,
15+ } ,
16+ {
17+ icon : < Download /> ,
18+ id : "download-certificates" ,
19+ href : "/certificates" ,
20+ textValue : "Download certificates" ,
21+ } ,
22+ ] ;
23+
24+ const HELP_MENU_ITEMS : OptionsSchema < "menu" > [ ] = [
25+ {
26+ textValue : "Setup" ,
27+ id : "setup" ,
28+ items : [
29+ {
30+ icon : < Continue /> ,
31+ id : "continue-setup" ,
32+ href : "/help/continue-setup" ,
33+ textValue : "Set up in Continue" ,
34+ } ,
35+ {
36+ icon : < Copilot /> ,
37+ id : "copilot-setup" ,
38+ href : "/help/copilot-setup" ,
39+ textValue : "Set up in Copilot" ,
40+ } ,
41+ ] ,
42+ } ,
43+ {
44+ textValue : "Resources" ,
45+ id : "resources" ,
46+ items : [
47+ {
48+ icon : < BookOpenText /> ,
49+ id : "documentation" ,
50+ href : "https://docs.codegate.ai/" ,
51+ textValue : "Documentation" ,
52+ } ,
53+ {
54+ icon : < Discord /> ,
55+ id : "discord" ,
56+ href : "https://discord.gg/stacklok" ,
57+ textValue : "Discord" ,
58+ } ,
59+ {
60+ icon : < Github /> ,
61+ id : "github" ,
62+ href : "https://github.com/stacklok/codegate" ,
63+ textValue : "GitHub" ,
64+ } ,
65+ {
66+ icon : < Youtube /> ,
67+ id : "youtube" ,
68+ href : "https://www.youtube.com/@Stacklok" ,
69+ textValue : "YouTube" ,
70+ } ,
71+ ] ,
72+ } ,
73+ ] ;
74+
975export function Header ( { hasError } : { hasError ?: boolean } ) {
1076 return (
1177 < header
@@ -31,61 +97,9 @@ export function Header({ hasError }: { hasError?: boolean }) {
3197 < WorkspacesSelection />
3298 </ div >
3399 < div className = "flex items-center gap-4 mr-16" >
34- < HoverPopover title = "Certificates" >
35- < MenuItem href = "/certificates/security" icon = { < ShieldCheck /> } >
36- About certificate security
37- </ MenuItem >
38- < MenuItem icon = { < Download /> } href = "/certificates" >
39- Download certificates
40- </ MenuItem >
41- </ HoverPopover >
42-
43- < HoverPopover title = "Help" >
44- < MenuItem href = "/help/continue-setup" icon = { < Continue /> } >
45- < span >
46- Set up in < span className = "font-bold" > Continue</ span >
47- </ span >
48- </ MenuItem >
49- < MenuItem icon = { < Copilot /> } href = "/help/copilot-setup" >
50- < span >
51- Set up in < span className = "font-bold" > Copilot</ span >
52- </ span >
53- </ MenuItem >
54-
55- < MenuItem
56- href = "https://docs.codegate.ai/"
57- target = "_blank"
58- icon = { < BookOpenText /> }
59- >
60- Documentation
61- </ MenuItem >
62-
63- < Separator />
64-
65- < MenuItem
66- href = "https://discord.gg/stacklok"
67- target = "_blank"
68- icon = { < Discord /> }
69- >
70- Discord
71- </ MenuItem >
72-
73- < MenuItem
74- href = "https://github.com/stacklok/codegate"
75- target = "_blank"
76- icon = { < Github /> }
77- >
78- GitHub
79- </ MenuItem >
100+ < DropdownMenu title = "Certificates" items = { CERTIFICATE_MENU_ITEMS } />
80101
81- < MenuItem
82- href = "https://www.youtube.com/@Stacklok"
83- target = "_blank"
84- icon = { < Youtube /> }
85- >
86- YouTube
87- </ MenuItem >
88- </ HoverPopover >
102+ < DropdownMenu title = "Help" items = { HELP_MENU_ITEMS } />
89103
90104 < ButtonDarkMode />
91105 </ div >
0 commit comments