@@ -7,6 +7,7 @@ import { usePathname } from "next/navigation";
77import { useCallback , useRef , useState } from "react" ;
88import { ScrollShadow } from "./ScrollShadow/ScrollShadow" ;
99import { Button } from "./button" ;
10+ import { ToolTipLabel } from "./tooltip" ;
1011
1112export type TabLink = {
1213 name : string ;
@@ -82,6 +83,7 @@ export function TabButtons(props: {
8283 isActive : boolean ;
8384 isDisabled ?: boolean ;
8485 icon ?: React . FC < { className ?: string } > ;
86+ toolTip ?: string ;
8587 } [ ] ;
8688 tabClassName ?: string ;
8789 activeTabClassName ?: string ;
@@ -111,26 +113,31 @@ export function TabButtons(props: {
111113 >
112114 { props . tabs . map ( ( tab , index ) => {
113115 return (
114- < Button
115- // biome-ignore lint/suspicious/noArrayIndexKey: tabs don't change order, so index is stable
116- key = { index }
117- variant = "ghost"
118- ref = { tab . isActive ? activeTabRef : undefined }
119- className = { cn (
120- "relative inline-flex h-auto items-center gap-1.5 rounded-lg px-2 font-medium text-sm hover:bg-accent lg:px-3 lg:text-base" ,
121- ! tab . isActive &&
122- "text-muted-foreground hover:text-foreground" ,
123- tab . isDisabled && "cursor-not-allowed opacity-50" ,
124- props . tabClassName ,
125- tab . isActive && props . activeTabClassName ,
126- ) }
127- onClick = { ! tab . isDisabled ? tab . onClick : undefined }
116+ < ToolTipLabel
117+ key = { typeof tab . name === "string" ? tab . name : index }
118+ label = { tab . toolTip }
128119 >
129- { tab . icon && (
130- < tab . icon className = { cn ( "size-6" , props . tabIconClassName ) } />
131- ) }
132- { tab . name }
133- </ Button >
120+ < Button
121+ variant = "ghost"
122+ ref = { tab . isActive ? activeTabRef : undefined }
123+ className = { cn (
124+ "relative inline-flex h-auto items-center gap-1.5 rounded-lg px-2 font-medium text-sm hover:bg-accent lg:px-3 lg:text-base" ,
125+ ! tab . isActive &&
126+ "text-muted-foreground hover:text-foreground" ,
127+ tab . isDisabled && "cursor-not-allowed opacity-50" ,
128+ props . tabClassName ,
129+ tab . isActive && props . activeTabClassName ,
130+ ) }
131+ onClick = { ! tab . isDisabled ? tab . onClick : undefined }
132+ >
133+ { tab . icon && (
134+ < tab . icon
135+ className = { cn ( "size-6" , props . tabIconClassName ) }
136+ />
137+ ) }
138+ { tab . name }
139+ </ Button >
140+ </ ToolTipLabel >
134141 ) ;
135142 } ) }
136143 </ div >
0 commit comments