11import { Link , useMatchRoute } from "@tanstack/react-router" ;
22import { motion } from "framer-motion" ;
3- import { Boxes , Brain , ChevronRight , LayoutDashboard , Moon , Settings , Sun } from "lucide-react" ;
3+ import {
4+ Boxes ,
5+ Brain ,
6+ ChevronRight ,
7+ Eye ,
8+ EyeOff ,
9+ LayoutDashboard ,
10+ Moon ,
11+ Settings ,
12+ Sun ,
13+ } from "lucide-react" ;
14+ import { useDemo } from "@/hooks/useDemo" ;
415import { useTheme } from "@/hooks/useTheme" ;
516import { loadConfig } from "@/lib/config" ;
617import { COLOR } from "@/lib/constants" ;
@@ -15,6 +26,7 @@ export function Sidebar() {
1526 const matchRoute = useMatchRoute ( ) ;
1627 const config = loadConfig ( ) ;
1728 const { theme, toggle } = useTheme ( ) ;
29+ const { demo, toggle : toggleDemo } = useDemo ( ) ;
1830
1931 return (
2032 < motion . aside
@@ -110,23 +122,42 @@ export function Sidebar() {
110122 < p className = "text-xs font-mono hidden sm:block" style = { { color : "var(--text-4)" } } >
111123 API v3
112124 </ p >
113- < button
114- type = "button"
115- onClick = { toggle }
116- className = "w-7 h-7 rounded-md flex items-center justify-center transition-colors mx-auto sm:mx-0"
117- style = { {
118- background : "var(--surface)" ,
119- border : "1px solid var(--border)" ,
120- color : "var(--text-3)" ,
121- } }
122- title = { theme === "dark" ? "Switch to light mode" : "Switch to dark mode" }
123- >
124- { theme === "dark" ? (
125- < Sun className = "w-3.5 h-3.5" strokeWidth = { 1.5 } />
126- ) : (
127- < Moon className = "w-3.5 h-3.5" strokeWidth = { 1.5 } />
128- ) }
129- </ button >
125+ < div className = "flex items-center gap-1.5 mx-auto sm:mx-0" >
126+ < button
127+ type = "button"
128+ onClick = { toggleDemo }
129+ className = "w-7 h-7 rounded-md flex items-center justify-center transition-colors"
130+ style = { {
131+ background : demo ? "var(--accent-dim)" : "var(--surface)" ,
132+ border : `1px solid ${ demo ? "var(--accent-border)" : "var(--border)" } ` ,
133+ color : demo ? "var(--accent-text)" : "var(--text-3)" ,
134+ } }
135+ title = { demo ? "Disable demo mode" : "Enable demo mode" }
136+ >
137+ { demo ? (
138+ < EyeOff className = "w-3.5 h-3.5" strokeWidth = { 1.5 } />
139+ ) : (
140+ < Eye className = "w-3.5 h-3.5" strokeWidth = { 1.5 } />
141+ ) }
142+ </ button >
143+ < button
144+ type = "button"
145+ onClick = { toggle }
146+ className = "w-7 h-7 rounded-md flex items-center justify-center transition-colors"
147+ style = { {
148+ background : "var(--surface)" ,
149+ border : "1px solid var(--border)" ,
150+ color : "var(--text-3)" ,
151+ } }
152+ title = { theme === "dark" ? "Switch to light mode" : "Switch to dark mode" }
153+ >
154+ { theme === "dark" ? (
155+ < Sun className = "w-3.5 h-3.5" strokeWidth = { 1.5 } />
156+ ) : (
157+ < Moon className = "w-3.5 h-3.5" strokeWidth = { 1.5 } />
158+ ) }
159+ </ button >
160+ </ div >
130161 </ div >
131162 </ motion . aside >
132163 ) ;
0 commit comments