import React, { Dispatch, HTMLAttributes, SetStateAction } from 'react'; import styled from 'styled-components'; import Tab from '../Tabs/Tab'; import Tabs from '../Tabs/Tabs'; export interface SegmentedProps extends HTMLAttributes { children?: React.ReactNode; options: React.ReactNode[]; value: React.ReactNode; changeValue: Dispatch>; } const SegmentedStyled = styled.div` display: inline-flex; `; const Segmented: React.FC = (props) => { const { children, options, value, changeValue, ...rest } = props; const onChange = (key: string) => { const index = parseInt(key, 10); changeValue(options[index]); }; return (
{options.map((item, index) => { return ; })}
); }; Segmented.defaultProps = { children: '' }; export default Segmented;