@@ -55,47 +55,38 @@ export function MetricsTable() {
5555 }
5656
5757 return (
58- < div className = "space-y-3" >
59- < div className = "flex flex-wrap gap-3 items-end" >
60- < div className = "form-control flex-1 min-w-48 max-w-xs" >
61- < label className = "label pb-1" >
62- < span className = "label-text text-xs font-medium text-base-content/60" > Search metrics</ span >
63- </ label >
64- < input
65- type = "text"
66- placeholder = "Filter by name..."
67- className = "input input-bordered input-sm"
68- value = { nameFilter }
69- onChange = { ( e ) => setNameFilter ( e . target . value ) }
70- />
71- </ div >
72- < div className = "form-control" >
73- < label className = "label pb-1" >
74- < span className = "label-text text-xs font-medium text-base-content/60" > Type</ span >
75- </ label >
76- < select
77- className = "select select-bordered select-sm"
78- value = { typeFilter }
79- onChange = { ( e ) => setTypeFilter ( e . target . value ) }
80- >
81- { SENSOR_TYPES . map ( ( t ) => (
82- < option key = { t } value = { t } >
83- { t || 'All types' }
84- </ option >
85- ) ) }
86- </ select >
87- </ div >
58+ < div className = "flex flex-col h-full gap-2" >
59+ < div className = "flex flex-wrap gap-2 items-center shrink-0" >
60+ < input
61+ type = "text"
62+ placeholder = "Filter by name..."
63+ className = "input input-bordered input-xs text-xs flex-1 min-w-36 max-w-xs h-7"
64+ value = { nameFilter }
65+ onChange = { ( e ) => setNameFilter ( e . target . value ) }
66+ />
67+ < select
68+ className = "select select-bordered select-xs text-xs h-7"
69+ value = { typeFilter }
70+ onChange = { ( e ) => setTypeFilter ( e . target . value ) }
71+ >
72+ { SENSOR_TYPES . map ( ( t ) => (
73+ < option key = { t } value = { t } >
74+ { t || 'All types' }
75+ </ option >
76+ ) ) }
77+ </ select >
8878 { ! isLoading && ! error && (
89- < span className = "text-xs text-base-content/40 pb-2 " >
79+ < span className = "text-xs text-base-content/40" >
9080 { metrics . length } metric{ metrics . length !== 1 ? 's' : '' }
9181 </ span >
9282 ) }
9383 </ div >
9484
85+ < div className = "flex-1 min-h-0 overflow-y-auto overflow-x-auto" >
9586 { isLoading && (
96- < div className = "flex items-center justify-center gap-2 py-12 " >
97- < span className = "loading loading-spinner loading-sm text-primary" />
98- < span className = "text-sm text-base-content/50" > Loading metrics ...</ span >
87+ < div className = "flex items-center justify-center gap-2 py-6 " >
88+ < span className = "loading loading-spinner loading-xs text-primary" />
89+ < span className = "text-xs text-base-content/50" > Loading...</ span >
9990 </ div >
10091 ) }
10192
@@ -109,8 +100,8 @@ export function MetricsTable() {
109100 ) }
110101
111102 { ! isLoading && ! error && metrics . length === 0 && (
112- < div className = "text-center py-12 " >
113- < p className = "text-sm text-base-content/40" > No metrics found</ p >
103+ < div className = "text-center py-6 " >
104+ < p className = "text-xs text-base-content/40" > No metrics found</ p >
114105 { ( nameFilter || typeFilter ) && (
115106 < button
116107 className = "btn btn-ghost btn-xs mt-2"
@@ -123,8 +114,8 @@ export function MetricsTable() {
123114 ) }
124115
125116 { ! isLoading && ! error && metrics . length > 0 && (
126- < div className = "overflow-x-auto -mx-1" >
127- < table className = "table table-sm w-full" >
117+ < div >
118+ < table className = "table table-xs w-full" >
128119 < thead >
129120 < tr className = "text-xs text-base-content/50" >
130121 < th className = "font-medium" > Metric Name</ th >
@@ -150,17 +141,17 @@ export function MetricsTable() {
150141 onClick = { ( ) => handleSelectMetric ( metric ) }
151142 >
152143 < td >
153- < div className = "font-mono text-sm font-medium" > { name } </ div >
144+ < span className = "font-mono text-xs font-medium" > { name } </ span >
154145 { metric [ 'sensor:unit' ] && (
155- < div className = "text-xs text-base-content/40 mt-0.5" > Unit: { metric [ 'sensor:unit' ] } </ div >
146+ < span className = "text-xs text-base-content/40 ml-1" > ( { metric [ 'sensor:unit' ] } ) </ span >
156147 ) }
157148 </ td >
158149 < td >
159150 < span className = { `badge badge-sm ${ sensorTypeBadgeClass ( metric [ 'sensor:type' ] ) } ` } >
160151 { metric [ 'sensor:type' ] }
161152 </ span >
162153 </ td >
163- < td className = "tabular-nums text-sm " >
154+ < td className = "tabular-nums text-xs " >
164155 { seriesCount ?? '—' }
165156 </ td >
166157 < td className = "hidden sm:table-cell" >
@@ -182,6 +173,7 @@ export function MetricsTable() {
182173 </ table >
183174 </ div >
184175 ) }
176+ </ div >
185177 </ div >
186178 ) ;
187179}
0 commit comments