1919
2020"use client" ;
2121
22- import { AppBar , Container , Toolbar , IconButton , Box , Tooltip , Typography } from "@mui/material" ;
22+ import {
23+ AppBar ,
24+ Container ,
25+ Toolbar ,
26+ IconButton ,
27+ Box ,
28+ Tooltip ,
29+ Typography ,
30+ Button ,
31+ } from "@mui/material" ;
2332import Image from "next/image" ;
2433import NavLinks from "./nav-links" ;
2534import { useTheme } from "../theme-provider" ;
@@ -29,6 +38,7 @@ import GitHubIcon from "@mui/icons-material/GitHub";
2938import HomeIcon from "@mui/icons-material/Home" ;
3039import FolderIcon from "@mui/icons-material/Folder" ;
3140import MenuBookIcon from "@mui/icons-material/MenuBook" ;
41+ import SearchIcon from "@mui/icons-material/Search" ;
3242import { usePathname } from "next/navigation" ;
3343import { useEffect , useState } from "react" ;
3444import Link from "next/link" ;
@@ -174,6 +184,53 @@ export default function Banner() {
174184 < NavLinks links = { links } scrolled = { scrolled } />
175185 </ Box >
176186
187+ < Box className = "flex items-center" >
188+ < Button
189+ onClick = { ( ) => {
190+ const event = new KeyboardEvent ( "keydown" , {
191+ key : "k" ,
192+ metaKey : true ,
193+ ctrlKey : true ,
194+ } ) ;
195+ window . dispatchEvent ( event ) ;
196+ } }
197+ startIcon = { < SearchIcon fontSize = "small" /> }
198+ sx = { {
199+ mr : 1 ,
200+ px : 1.5 ,
201+ py : 0.5 ,
202+ fontSize : "0.875rem" ,
203+ textTransform : "none" ,
204+ backgroundColor : isDarkMode
205+ ? "rgba(255,255,255,0.1)"
206+ : "rgba(0,0,0,0.05)" ,
207+ color : isDarkMode ? "rgba(255,255,255,0.9)" : "rgba(0,0,0,0.7)" ,
208+ borderRadius : 2 ,
209+ transition : "all 0.3s ease" ,
210+ "&:hover" : {
211+ backgroundColor : isDarkMode
212+ ? "rgba(255,255,255,0.2)"
213+ : "rgba(0,0,0,0.08)" ,
214+ } ,
215+ } }
216+ >
217+ < Box component = "span" sx = { { mr : 0.5 } } >
218+ Search
219+ </ Box >
220+ < Box
221+ component = "kbd"
222+ sx = { {
223+ fontSize : "0.7rem" ,
224+ px : 0.5 ,
225+ py : 0.25 ,
226+ ml : 0.5 ,
227+ } }
228+ >
229+ ⌘K
230+ </ Box >
231+ </ Button >
232+ </ Box >
233+
177234 < Box className = "flex items-center" >
178235 < Tooltip title = "Toggle dark mode" >
179236 < IconButton
0 commit comments