@@ -5,6 +5,7 @@ import { state } from "../App";
55import Button from "./Button" ;
66import { EvaluationTable } from "./EvaluationTable" ;
77import PivotTable from "./PivotTable" ;
8+ import TabButton from "./TabButton" ;
89import flattenJson from "../util/flatten-json" ;
910
1011interface DashboardProps {
@@ -91,46 +92,30 @@ const Dashboard = observer(({ onRefresh }: DashboardProps) => {
9192 ) : (
9293 < div className = "bg-white border border-gray-200" >
9394 { /* Tabs + contextual actions */ }
94- < div className = "px-3 pt-2 border-b border-gray-200" >
95- < div className = "flex items-center justify-between" >
96- < div className = "flex gap-1" >
97- < button
98- type = "button"
99- role = "tab"
100- aria-selected = { activeTab === "table" }
101- title = "View table"
95+ < div className = "px-3 pt-2 border-b border-gray-200" >
96+ < div className = "flex justify-between h-8" >
97+ < div id = "tabs" className = "flex gap-1" >
98+ < TabButton
99+ label = "Table"
100+ isActive = { activeTab === "table" }
102101 onClick = { ( ) => {
103102 setActiveTab ( "table" ) ;
104103 navigate ( "/table" ) ;
105104 } }
106- className = { `text-xs px-3 py-2 border-b-2 -mb-px rounded-none focus:outline-none cursor-pointer transition-colors ${
107- activeTab === "table"
108- ? "text-gray-900 font-semibold border-gray-900 bg-transparent"
109- : "text-gray-600 hover:text-gray-800 hover:border-gray-400 border-transparent bg-transparent hover:bg-gray-100"
110- } `}
111- >
112- Table
113- </ button >
114- < button
115- type = "button"
116- role = "tab"
117- aria-selected = { activeTab === "pivot" }
118- title = "View pivot"
105+ title = "View table"
106+ />
107+ < TabButton
108+ label = "Pivot"
109+ isActive = { activeTab === "pivot" }
119110 onClick = { ( ) => {
120111 setActiveTab ( "pivot" ) ;
121112 navigate ( "/pivot" ) ;
122113 } }
123- className = { `text-xs px-3 py-2 border-b-2 -mb-px rounded-none focus:outline-none cursor-pointer transition-colors ${
124- activeTab === "pivot"
125- ? "text-gray-900 font-semibold border-gray-900 bg-transparent"
126- : "text-gray-600 hover:text-gray-800 hover:border-gray-400 border-transparent bg-transparent hover:bg-gray-100"
127- } `}
128- >
129- Pivot
130- </ button >
114+ title = "View pivot"
115+ />
131116 </ div >
132117 { activeTab === "table" && (
133- < div className = "flex gap-2 pb-1 " >
118+ < div className = "flex gap-2 pb-2 " >
134119 < Button onClick = { expandAll } size = "sm" variant = "secondary" >
135120 Expand All
136121 </ Button >
0 commit comments