11import { SectionToggle } from './SectionToggle'
2- import { type TableDiffData , type SampleValue , themeColors } from './types'
2+ import { type TableDiffData , type SampleValue } from './types'
3+ import { twColors , twMerge } from './tailwind-utils'
34
45interface ColumnStatsSectionProps {
56 columnStats : TableDiffData [ 'row_diff' ] [ 'column_stats' ]
@@ -14,9 +15,8 @@ interface StatHeaderProps {
1415const StatHeader = ( { stat } : StatHeaderProps ) => (
1516 < th
1617 key = { stat }
17- className = " text-left py-2 px-1 font-medium w-16"
18+ className = { twMerge ( ' text-left py-2 px-1 font-medium w-16' , twColors . textMuted ) }
1819 title = { stat }
19- style = { { color : themeColors . muted } }
2020 >
2121 { stat . length > 6 ? stat . slice ( 0 , 6 ) + '..' : stat }
2222 </ th >
@@ -28,9 +28,8 @@ interface StatCellProps {
2828
2929const StatCell = ( { value } : StatCellProps ) => (
3030 < td
31- className = " py-2 px-1 font-mono text-xs truncate"
31+ className = { twMerge ( ' py-2 px-1 font-mono text-xs truncate' , twColors . textMuted ) }
3232 title = { String ( value ) }
33- style = { { color : themeColors . muted } }
3433 >
3534 { typeof value === 'number'
3635 ? value . toFixed ( 1 )
@@ -47,17 +46,11 @@ interface ColumnStatRowProps {
4746
4847const ColumnStatRow = ( { columnName, statsValue } : ColumnStatRowProps ) => (
4948 < tr
50- className = "transition-colors"
51- style = { {
52- borderBottom : `1px solid ${ themeColors . border } ` ,
53- } }
54- onMouseEnter = { e => {
55- e . currentTarget . style . backgroundColor =
56- 'var(--vscode-list-hoverBackground)'
57- } }
58- onMouseLeave = { e => {
59- e . currentTarget . style . backgroundColor = 'transparent'
60- } }
49+ className = { twMerge (
50+ 'transition-colors border-b' ,
51+ twColors . borderPanel ,
52+ twColors . bgHover
53+ ) }
6154 >
6255 < td
6356 className = "py-2 pr-2 font-mono truncate"
@@ -94,32 +87,21 @@ export function ColumnStatsSection({
9487 id = "columnStats"
9588 title = "Column Statistics"
9689 badge = { `${ Object . keys ( columnStats ) . length } columns` }
97- badgeStyle = { {
98- backgroundColor : 'var(--vscode-input-background)' ,
99- color : 'var(--vscode-symbolIcon-classForeground, #9b59b6)' ,
100- borderColor : 'var(--vscode-symbolIcon-classForeground, #9b59b6)' ,
101- } }
90+ badgeClassName = { twMerge (
91+ 'px-2 py-1 text-xs rounded border' ,
92+ twColors . bgInput ,
93+ 'text-[var(--vscode-symbolIcon-classForeground,#9b59b6)]' ,
94+ 'border-[var(--vscode-symbolIcon-classForeground,#9b59b6)]'
95+ ) }
10296 expanded = { expanded }
10397 onToggle = { onToggle }
10498 >
10599 < div className = "px-8 py-3" >
106100 < div className = "overflow-auto max-h-80" >
107101 < table className = "w-full text-xs table-fixed" >
108- < thead
109- className = "sticky top-0 z-10"
110- style = { {
111- backgroundColor : 'var(--vscode-editor-background)' ,
112- } }
113- >
114- < tr
115- style = { {
116- borderBottom : `1px solid ${ themeColors . border } ` ,
117- } }
118- >
119- < th
120- className = "text-left py-2 pr-2 font-medium w-28"
121- style = { { color : themeColors . muted } }
122- >
102+ < thead className = { twMerge ( 'sticky top-0 z-10' , twColors . bgEditor ) } >
103+ < tr className = { twMerge ( 'border-b' , twColors . borderPanel ) } >
104+ < th className = { twMerge ( 'text-left py-2 pr-2 font-medium w-28' , twColors . textMuted ) } >
123105 Column
124106 </ th >
125107 { statKeys . map ( stat => (
0 commit comments