11import { Link } from 'react-router-dom' ;
22import { Badge } from '../shared/Badge.tsx' ;
33import { DisplayIdentity } from '../shared/DisplayIdentity.tsx' ;
4+ import { tableHeaderStyle , tableCellStyle } from '../../lib/theme' ;
45
56interface Vertex {
67 hash : string ;
@@ -19,48 +20,61 @@ interface RoundTableProps {
1920 } > ;
2021}
2122
23+ const thStyle : React . CSSProperties = {
24+ ...tableHeaderStyle ,
25+ padding : '8px 12px' ,
26+ textAlign : 'left' ,
27+ } ;
28+
29+ const tdStyle : React . CSSProperties = {
30+ ...tableCellStyle ,
31+ padding : '10px 12px' ,
32+ } ;
33+
2234export function RoundTable ( { rounds } : RoundTableProps ) {
2335 if ( rounds . length === 0 ) {
24- return < p className = "text-slate-500 text-sm py-8 text- center" > No rounds to display</ p > ;
36+ return < p style = { { color : 'var(--dag- text-faint)' , fontSize : 12 , padding : '32px 0' , textAlign : ' center' } } > No rounds to display</ p > ;
2537 }
2638
2739 return (
28- < div className = "overflow-x- auto" >
29- < table className = "w-full text-sm" >
40+ < div style = { { overflowX : ' auto' } } >
41+ < table style = { { width : '100%' , fontSize : 12 , borderCollapse : 'collapse' } } >
3042 < thead >
31- < tr className = "text-left text-slate-400 border-b border-slate-700" >
32- < th className = "py-2 px-3 font-medium w-28" > Round</ th >
33- < th className = "py-2 px-3 font-medium w-20 text- center" > Vertices</ th >
34- < th className = "py-2 px-3 font-medium w-16 text- center" > Txns</ th >
35- < th className = "py-2 px-3 font-medium" > Validators</ th >
36- < th className = "py-2 px-3 font-medium w-24" > Status</ th >
43+ < tr >
44+ < th style = { { ... thStyle , width : 112 } } > Round</ th >
45+ < th style = { { ... thStyle , width : 80 , textAlign : ' center' } } > Vertices</ th >
46+ < th style = { { ... thStyle , width : 64 , textAlign : ' center' } } > Txns</ th >
47+ < th style = { thStyle } > Validators</ th >
48+ < th style = { { ... thStyle , width : 96 } } > Status</ th >
3749 </ tr >
3850 </ thead >
3951 < tbody >
4052 { rounds . map ( ( r ) => {
4153 const totalTxs = r . vertices . reduce ( ( sum , v ) => sum + v . tx_count , 0 ) ;
4254 return (
43- < tr key = { r . round } className = "border-b border-slate-800 hover:bg-slate-800/50 transition-colors" >
44- < td className = "py-2.5 px-3" >
45- < Link to = { `/round/${ r . round } ` } className = "text-blue-400 hover:text-blue-300 font-mono font-bold text-base" >
55+ < tr key = { r . round } style = { { transition : 'background 0.15s' } } >
56+ < td style = { tdStyle } >
57+ < Link to = { `/round/${ r . round } ` } style = { { color : '#00E0C4' , textDecoration : 'none' , fontFamily : "'DM Mono',monospace" , fontWeight : 700 , fontSize : 14 } } >
4658 #{ r . round . toLocaleString ( ) }
4759 </ Link >
4860 </ td >
49- < td className = "py-2.5 px-3 font-mono text-center text-slate-300" > { r . vertices . length } </ td >
50- < td className = "py-2.5 px-3 font-mono text-center text-slate-300" > { totalTxs > 0 ? totalTxs : < span className = "text-slate-600" > 0</ span > } </ td >
51- < td className = "py-2.5 px-3" >
52- < div className = "flex flex-wrap gap-1" >
61+ < td style = { { ...tdStyle , fontFamily : "'DM Mono',monospace" , textAlign : 'center' , color : 'var(--dag-text-secondary)' } } > { r . vertices . length } </ td >
62+ < td style = { { ...tdStyle , fontFamily : "'DM Mono',monospace" , textAlign : 'center' , color : 'var(--dag-text-secondary)' } } >
63+ { totalTxs > 0 ? totalTxs : < span style = { { color : 'var(--dag-text-faint)' } } > 0</ span > }
64+ </ td >
65+ < td style = { tdStyle } >
66+ < div style = { { display : 'flex' , flexWrap : 'wrap' , gap : 4 } } >
5367 { r . vertices . slice ( 0 , 3 ) . map ( ( v ) => (
54- < span key = { v . hash } className = " inline-flex items- center gap-1 text-xs" >
68+ < span key = { v . hash } style = { { display : ' inline-flex' , alignItems : ' center' , gap : 4 , fontSize : 11 } } >
5569 < DisplayIdentity address = { v . validator } link size = "xs" />
5670 </ span >
5771 ) ) }
5872 { r . vertices . length > 3 && (
59- < span className = "text-xs text-slate-500" > +{ r . vertices . length - 3 } more</ span >
73+ < span style = { { fontSize : 10 , color : 'var(--dag-text-faint)' } } > +{ r . vertices . length - 3 } more</ span >
6074 ) }
6175 </ div >
6276 </ td >
63- < td className = "py-2.5 px-3" >
77+ < td style = { tdStyle } >
6478 < Badge label = { r . finalized ? 'Finalized' : 'Pending' } variant = { r . finalized ? 'green' : 'yellow' } />
6579 </ td >
6680 </ tr >
0 commit comments