@@ -5,8 +5,10 @@ import { createFileRoute } from '@tanstack/react-router';
55import { LoaderCircle } from 'lucide-react' ;
66import WorkerpoolIcon from '@/components/icons/WorkerpoolIcon' ;
77import { BackButton } from '@/components/ui/BackButton' ;
8+ import { useTabParam } from '@/hooks/usePageParam' ;
89import { DetailsTable } from '@/modules/DetailsTable' ;
910import { ErrorAlert } from '@/modules/ErrorAlert' ;
11+ import { Tabs } from '@/modules/Tabs' ;
1012import { SearcherBar } from '@/modules/search/SearcherBar' ;
1113import { WorkerpoolDealsTable } from '@/modules/workerpools/workerpool/WorkerpoolDealsTable' ;
1214import { buildWorkerpoolDetails } from '@/modules/workerpools/workerpool/buildWorkerpoolDetails' ;
@@ -57,6 +59,12 @@ function useWorkerpoolData(workerpoolAddress: string, chainId: number) {
5759}
5860
5961function WorkerpoolsRoute ( ) {
62+ const tabLabels = [ 'DETAILS' , 'DEALS' , 'ACCESS' ] ;
63+ const [ currentTab , setCurrentTab ] = useTabParam (
64+ 'workerpoolTab' ,
65+ tabLabels ,
66+ 0
67+ ) ;
6068 const { chainId } = useUserStore ( ) ;
6169 const { workerpoolAddress } = Route . useParams ( ) ;
6270 const {
@@ -107,14 +115,20 @@ function WorkerpoolsRoute() {
107115 </ div >
108116 </ div >
109117
110- < div className = "space-y-10" >
111- { hasPastError && ! workerpoolDetails ? (
118+ < Tabs
119+ currentTab = { currentTab }
120+ tabLabels = { tabLabels }
121+ onTabChange = { setCurrentTab }
122+ />
123+ { currentTab === 0 &&
124+ ( hasPastError && ! workerpoolDetails ? (
112125 < ErrorAlert message = "An error occurred during deal details loading." />
113126 ) : (
114127 < DetailsTable details = { workerpoolDetails || { } } zebra = { false } />
115- ) }
128+ ) ) }
129+ { currentTab === 1 && (
116130 < WorkerpoolDealsTable workerpoolAddress = { workerpoolAddress } />
117- </ div >
131+ ) }
118132 </ div >
119133 ) ;
120134}
0 commit comments