import React, { SyntheticEvent } from 'react'; import { Box, SxProps } from '@mui/material'; import { ColorVariant, DataTabs, MuiTabsBaseProps, TabsVariant } from '@/types'; import { NormaTab, NormaTabs } from './UncontrolledTabs.style'; import { Theme } from '@emotion/react'; import { NormaTabInfo } from './UncontrolledTabsInfo.style'; interface Props extends MuiTabsBaseProps { sx?: SxProps; tabs: DataTabs[]; tab: number; onTabChange: (event: SyntheticEvent, tab: number) => void; color?: ColorVariant; variant?: TabsVariant; info?: React.ReactNode; tabPanelSx?: SxProps; } interface TabPanelProps { children?: React.ReactNode; index: number; value: number; sx?: SxProps; } function TabPanel(props: TabPanelProps) { const { children, value, index, sx, ...other } = props; return ( ); } function a11yProps(index: number) { return { id: `simple-tab-${index}`, 'aria-controls': `simple-tabpanel-${index}`, }; } const UncontrolledTabs = ({ tabs, tab, color = 'primary', onTabChange, info, ...props }: Props) => { const handleChange = (event: SyntheticEvent, newValue: number) => { onTabChange(event, newValue); }; return ( {tabs.map((item, key) => ( ))} {info && {info}} {tabs.map((item, key) => ( {item.children} ))} ); }; export default UncontrolledTabs;