@@ -8,9 +8,9 @@ import {type SxProp} from '../../sx'
88import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../../utils/polymorphic'
99import { defaultSxProp } from '../../utils/defaultSxProp'
1010
11- import { toggleSxComponent } from '../utils/toggleSxComponent'
1211import classes from './UnderlineTabbedInterface.module.css'
1312import { clsx } from 'clsx'
13+ import { BoxWithFallback } from './BoxWithFallback'
1414
1515// The gap between the list items. It is a constant because the gap is used to calculate the possible number of items that can fit in the container.
1616export const GAP = 8
@@ -22,24 +22,15 @@ type UnderlineWrapperProps = {
2222 ref ?: React . Ref < unknown >
2323} & SxProp
2424
25- const UnderlineWrapperComponent = toggleSxComponent ( 'div' ) as React . ComponentType <
26- PropsWithChildren < UnderlineWrapperProps >
27- >
28-
2925export const UnderlineWrapper = forwardRef (
3026 (
3127 { children, className, sx : sxProp = defaultSxProp , ...rest } : PropsWithChildren < UnderlineWrapperProps > ,
3228 forwardedRef ,
3329 ) => {
3430 return (
35- < UnderlineWrapperComponent
36- className = { clsx ( classes . UnderlineWrapper , className ) }
37- ref = { forwardedRef }
38- sx = { sxProp }
39- { ...rest }
40- >
31+ < BoxWithFallback className = { clsx ( classes . UnderlineWrapper , className ) } ref = { forwardedRef } sx = { sxProp } { ...rest } >
4132 { children }
42- </ UnderlineWrapperComponent >
33+ </ BoxWithFallback >
4334 )
4435 } ,
4536)
@@ -99,8 +90,6 @@ export type UnderlineItemProps = {
9990 ref ?: React . Ref < unknown >
10091} & SxProp
10192
102- const UnderlineComponent = toggleSxComponent ( 'a' ) as React . ComponentType < PropsWithChildren < UnderlineItemProps > >
103-
10493export const UnderlineItem = forwardRef (
10594 (
10695 {
@@ -116,7 +105,7 @@ export const UnderlineItem = forwardRef(
116105 forwardedRef ,
117106 ) => {
118107 return (
119- < UnderlineComponent ref = { forwardedRef } as = { as } sx = { sxProp } className = { classes . UnderlineItem } { ...rest } >
108+ < BoxWithFallback ref = { forwardedRef } as = { as } sx = { sxProp } className = { classes . UnderlineItem } { ...rest } >
120109 { iconsVisible && Icon && < span data-component = "icon" > { isElement ( Icon ) ? Icon : < Icon /> } </ span > }
121110 { children && (
122111 < span data-component = "text" data-content = { children } >
@@ -134,7 +123,7 @@ export const UnderlineItem = forwardRef(
134123 </ span >
135124 )
136125 ) : null }
137- </ UnderlineComponent >
126+ </ BoxWithFallback >
138127 )
139128 } ,
140129) as PolymorphicForwardRefComponent < 'a' , UnderlineItemProps >
0 commit comments