@@ -19,7 +19,7 @@ import Footer from "@/components/layout/Footer";
1919import ParameterExplorer from "@/components/dashboard/ParameterExplorer" ;
2020import TimeSlider , { type MonthlySnapshot } from "@/components/map/TimeSlider" ;
2121import { Droplets , MapPin , TrendingUp , Shield , SlidersHorizontal } from "lucide-react" ;
22- import { useState , useCallback , useEffect } from "react" ;
22+ import { useState , useCallback } from "react" ;
2323import type { MonitoringStation } from "@/data/dc-waterways" ;
2424import { useTheme } from "@/context/ThemeContext" ;
2525import { useLanguage } from "@/context/LanguageContext" ;
@@ -37,34 +37,6 @@ const DCMap = dynamic(() => import("@/components/map/DCMap"), {
3737 ) ,
3838} ) ;
3939
40- function OverflowDebug ( ) {
41- const [ info , setInfo ] = useState < string [ ] > ( [ ] ) ;
42- const [ show , setShow ] = useState ( false ) ;
43- useEffect ( ( ) => {
44- const timer = setTimeout ( ( ) => {
45- const w = document . documentElement . clientWidth ;
46- const found : string [ ] = [ `Viewport: ${ w } px` ] ;
47- document . querySelectorAll ( "*" ) . forEach ( ( el ) => {
48- const r = el . getBoundingClientRect ( ) ;
49- if ( r . right > w + 2 ) {
50- const tag = el . tagName . toLowerCase ( ) ;
51- const cls = typeof el . className === "string" ? el . className . split ( " " ) . slice ( 0 , 4 ) . join ( " " ) : "" ;
52- found . push ( `<${ tag } > cls="${ cls } " right=${ Math . round ( r . right ) } overflow=${ Math . round ( r . right - w ) } px` ) ;
53- }
54- } ) ;
55- setInfo ( found ) ;
56- } , 3000 ) ;
57- return ( ) => clearTimeout ( timer ) ;
58- } , [ ] ) ;
59- if ( info . length <= 1 ) return null ;
60- return (
61- < div style = { { position : "fixed" , bottom : 60 , left : 8 , right : 8 , zIndex : 99999 , background : "rgba(0,0,0,0.95)" , color : "#0f0" , fontSize : 9 , padding : 8 , borderRadius : 8 , maxHeight : 200 , overflow : "auto" } } >
62- < button onClick = { ( ) => setShow ( ! show ) } style = { { color : "#ff0" , marginBottom : 4 } } > { show ? "Hide" : `Show ${ info . length - 1 } overflow elements` } </ button >
63- { show && info . map ( ( s , i ) => < div key = { i } style = { { marginBottom : 2 } } > { s } </ div > ) }
64- </ div >
65- ) ;
66- }
67-
6840export default function Dashboard ( ) {
6941 const [ selectedStation , setSelectedStation ] = useState < MonitoringStation | null > ( null ) ;
7042 const [ monthSnapshot , setMonthSnapshot ] = useState < MonthlySnapshot | null > ( null ) ;
@@ -261,8 +233,6 @@ export default function Dashboard() {
261233 < Footer />
262234 </ div >
263235 </ main >
264- < OverflowDebug />
265-
266236 { /* Parameter Explorer Slide-out */ }
267237 < ParameterExplorer
268238 open = { explorerOpen }
0 commit comments