({shouldSelectOnPressUp, ...props}: TabProps)
| 22 | } |
| 23 | |
| 24 | export function Tabs({shouldSelectOnPressUp, ...props}: TabProps): JSX.Element { |
| 25 | let state = useTabListState(props); |
| 26 | let ref = React.useRef(null); |
| 27 | let {tabListProps} = useTabList(props, state, ref); |
| 28 | return ( |
| 29 | <div style={{height: '150px'}}> |
| 30 | <div |
| 31 | {...tabListProps} |
| 32 | ref={ref} |
| 33 | style={{ |
| 34 | display: 'flex', |
| 35 | borderBottom: '1px solid grey', |
| 36 | borderLeft: '10px solid grey', |
| 37 | borderRight: '20px solid grey', |
| 38 | maxWidth: '400px', |
| 39 | overflow: 'auto' |
| 40 | }}> |
| 41 | {[...state.collection].map(item => ( |
| 42 | <Tab |
| 43 | key={item.key} |
| 44 | item={item} |
| 45 | state={state} |
| 46 | shouldSelectOnPressUp={shouldSelectOnPressUp} |
| 47 | /> |
| 48 | ))} |
| 49 | </div> |
| 50 | <TabPanel key={state.selectedItem?.key} state={state} /> |
| 51 | </div> |
| 52 | ); |
| 53 | } |
| 54 | |
| 55 | function Tab({shouldSelectOnPressUp, item, state}) { |
| 56 | let {key, rendered} = item; |
nothing calls this directly
no test coverage detected