File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,14 @@ export function GatewayFeatureTabs(props: { className?: string }) {
61
61
'border-blue-200 [--tab-bg-dark:theme(colors.blue.300)] [--tab-bg:theme(colors.blue.200)]' ,
62
62
props . className ,
63
63
) }
64
+ tabTexts = { {
65
+ 'Observability & Performance Monitoring' : (
66
+ < span >
67
+ Observability & Performance { ' ' }
68
+ < span className = "[@media(width<420px)]:hidden" > Monitoring</ span >
69
+ </ span >
70
+ ) ,
71
+ } }
64
72
>
65
73
< FeatureTab
66
74
title = "Observability & Performance Monitoring"
Original file line number Diff line number Diff line change 1
1
'use client' ;
2
2
3
- import { createContext , useContext , useState } from 'react' ;
3
+ import { createContext , ReactNode , useContext , useState } from 'react' ;
4
4
import Image , { StaticImageData } from 'next/image' ;
5
5
import NextLink from 'next/link' ;
6
6
import { ChevronDownIcon } from '@radix-ui/react-icons' ;
@@ -20,13 +20,18 @@ export interface FeatureTabsProps<T extends string> {
20
20
highlights : Record < T , Highlight [ ] > ;
21
21
icons : React . ReactNode [ ] ;
22
22
children : React . ReactNode ;
23
+ /**
24
+ * On very narrow screens, we shorten the tab names.
25
+ */
26
+ tabTexts ?: Partial < Record < T , ReactNode > > ;
23
27
}
24
28
25
29
export function FeatureTabs < T extends string > ( {
26
30
className,
27
31
highlights,
28
32
icons,
29
33
children,
34
+ tabTexts = { } ,
30
35
} : FeatureTabsProps < T > ) {
31
36
const tabs = Object . keys ( highlights ) as T [ ] ;
32
37
const [ currentTab , setCurrentTab ] = useState < T > ( tabs [ 0 ] ) ;
@@ -64,7 +69,7 @@ export function FeatureTabs<T extends string>({
64
69
className = 'hive-focus rdx-state-active:text-green-1000 rdx-state-active:border-[--tab-bg-dark] rdx-state-active:bg-white max-sm:rdx-state-inactive:hidden group-focus-within:rdx-state-inactive:flex max-sm:rdx-state-inactive:rounded-none max-sm:group-focus-within:rdx-state-inactive:border-y-[--tab-bg] max-sm:group-focus-within:[&:nth-child(2)]:rdx-state-active:rounded-none max-sm:group-focus-within:[&:nth-child(2)]:rdx-state-active:border-y-[--tab-bg] max-sm:group-focus-within:first:rdx-state-active:border-b-[--tab-bg] max-sm:group-focus-within:first:rdx-state-active:rounded-b-none max-sm:rdx-state-inactive:pointer-events-none max-sm:rdx-state-inactive:group-focus-within:pointer-events-auto z-10 flex flex-1 items-center justify-center gap-2.5 rounded-lg border-transparent p-4 text-base font-medium leading-6 text-green-800 max-sm:border max-sm:border-[--tab-bg-dark] max-sm:bg-[--tab-bg] max-sm:group-focus-within:aria-selected:z-20 max-sm:group-focus-within:aria-selected:ring-4 sm:rounded-[15px] sm:border sm:text-xs sm:max-lg:p-3 sm:max-[721px]:p-2 md:text-sm lg:text-base max-sm:group-focus-within:[&:last-child]:border-t-[--tab-bg] max-sm:group-focus-within:[&:nth-child(3)]:rounded-t-none [&>svg]:shrink-0 max-sm:group-focus-within:[&[data-state="inactive"]:first-child]:rounded-t-lg max-sm:group-focus-within:[&[data-state="inactive"]:first-child]:border-t-[--tab-bg-dark] [&[data-state="inactive"]>:last-child]:invisible max-sm:group-focus-within:[[data-state="active"]+&:last-child]:rounded-b-lg max-sm:group-focus-within:[[data-state="active"]+&:last-child]:border-b-[--tab-bg-dark] max-sm:group-focus-within:[[data-state="inactive"]+&:last-child[data-state="inactive"]]:rounded-b-lg max-sm:group-focus-within:[[data-state="inactive"]+&:last-child[data-state="inactive"]]:border-b-[--tab-bg-dark]'
65
70
>
66
71
{ icons [ i ] }
67
- { tab }
72
+ { tabTexts [ tab ] || tab }
68
73
< ChevronDownIcon className = "ml-auto size-6 text-green-800 transition group-focus-within:rotate-90 sm:hidden" />
69
74
</ Tabs . Trigger >
70
75
) ;
You can’t perform that action at this time.
0 commit comments