@@ -6,7 +6,7 @@ import { Badge } from "@/components/ui/Badge";
66import { Button } from "@/components/ui/Button" ;
77import { Timeline } from "@/features/status/components/Timeline" ;
88import Link from "next/link" ;
9- import { Search , Moon , Sun , Activity } from "lucide-react" ;
9+ import { Search , Moon , Sun , Activity , X } from "lucide-react" ;
1010import { cn } from "@/lib/utils" ;
1111import { useTheme } from "@/components/ThemeProvider" ;
1212import { NotificationDropdown } from "@/components/ui/NotificationDropdown" ;
@@ -72,7 +72,12 @@ export default function Dashboard() {
7272 </ div >
7373 < div className = "flex items-center gap-3" >
7474 < NotificationDropdown />
75- < Button variant = "ghost" size = "sm" onClick = { toggleTheme } >
75+ < Button
76+ variant = "ghost"
77+ size = "sm"
78+ onClick = { toggleTheme }
79+ aria-label = { theme === "dark" ? "Switch to light mode" : "Switch to dark mode" }
80+ >
7681 { theme === "dark" ? < Sun size = { 16 } /> : < Moon size = { 16 } /> }
7782 </ Button >
7883 < div className = "flex items-center gap-2 px-3 py-1.5 rounded-full border border-[var(--card-border)] bg-[var(--secondary-bg)]" >
@@ -120,10 +125,19 @@ export default function Dashboard() {
120125 id = "search-monitors"
121126 type = "text"
122127 placeholder = "Search by name or URL"
123- className = "w-full pl-10 pr-4 py-2 rounded-xl border border-[var(--card-border)] bg-[var(--input-bg)] focus:outline-none focus:ring-2 focus:ring-indigo-500"
128+ className = "w-full pl-10 pr-10 py-2 rounded-xl border border-[var(--card-border)] bg-[var(--input-bg)] focus:outline-none focus:ring-2 focus:ring-indigo-500"
124129 value = { search }
125130 onChange = { ( e ) => setSearch ( e . target . value ) }
126131 />
132+ { search && (
133+ < button
134+ onClick = { ( ) => setSearch ( "" ) }
135+ className = "absolute right-3 top-1/2 -translate-y-1/2 text-muted hover:text-[var(--foreground)] transition-colors"
136+ aria-label = "Clear search"
137+ >
138+ < X size = { 16 } />
139+ </ button >
140+ ) }
127141 </ div >
128142 </ div >
129143 < div className = "flex gap-4 text-xs font-medium text-muted" >
@@ -137,6 +151,20 @@ export default function Dashboard() {
137151 </ Card >
138152
139153 < div className = { cn ( "grid grid-cols-1 md:grid-cols-2 gap-6 transition-opacity" , loading && "opacity-50" ) } >
154+ { filteredSiteData . length === 0 && search && (
155+ < div className = "col-span-full py-16 flex flex-col items-center text-center space-y-4" >
156+ < div className = "w-16 h-16 rounded-full bg-[var(--secondary-bg)] flex items-center justify-center" >
157+ < Search className = "text-muted" size = { 32 } />
158+ </ div >
159+ < div >
160+ < h3 className = "text-lg font-bold" > No monitors found</ h3 >
161+ < p className = "text-sm text-muted" > No results for "{ search } ". Try a different term.</ p >
162+ </ div >
163+ < Button variant = "outline" size = "sm" onClick = { ( ) => setSearch ( "" ) } >
164+ Clear Search
165+ </ Button >
166+ </ div >
167+ ) }
140168 { filteredSiteData . map ( ( data ) => {
141169 const { site } = data ;
142170 return (
0 commit comments