@@ -15,10 +15,11 @@ import { Icon } from "./Icon";
1515import { isString } from "@/utils/isString" ;
1616import { isComponentState } from "@/types/state/component" ;
1717
18- interface TabState {
18+ interface TabState extends ComponentState {
1919 type : "Tab" ;
2020 label ?: string ;
2121 icon ?: string ;
22+ iconPosition ?: "bottom" | "end" | "start" | "top" ;
2223 disabled ?: boolean ;
2324 children ?: ComponentProps [ ] ;
2425}
@@ -50,20 +51,22 @@ export function Tabs({
5051 }
5152 } ;
5253 return (
53- < MuiBox sx = { { width : "100%" } } >
54+ < MuiBox sx = { { width : "100%" } } style = { style } >
5455 < MuiBox sx = { { borderBottom : 1 , borderColor : "divider" } } >
55- < MuiTabs id = { id } style = { style } value = { value } onChange = { handleChange } >
56+ < MuiTabs id = { id } value = { value } onChange = { handleChange } >
5657 { tabItems ?. map ( ( tab , index ) => {
5758 const tabState = isComponentState ( tab )
5859 ? ( tab as TabState )
5960 : undefined ;
6061 return (
6162 < MuiTab
6263 key = { index }
64+ style = { tabState ?. style }
6365 label = { tabState ? tabState . label : isString ( tab ) ? tab : "" }
6466 icon = {
6567 tabState && tabState . icon && < Icon iconName = { tabState . icon } />
6668 }
69+ iconPosition = { tabState ?. iconPosition }
6770 disabled = { disabled || ( tabState && tabState . disabled ) }
6871 />
6972 ) ;
@@ -78,7 +81,7 @@ export function Tabs({
7881 key = { index }
7982 type = { type }
8083 onChange = { onChange }
81- children = { tabState ?. children ?? undefined }
84+ children = { tabState ?. children }
8285 />
8386 )
8487 ) ;
0 commit comments