import * as React from "react" ; export function Tabs < TKey extends string > ( props ) { const buttonElements = Object . keys ( props . optionNamesById ) . map ( ( key , i ) => { const isSelected = props . selected == props . optionNamesById [ key ] || props . selected == key ; return ( < button type = "button" key = { key } className = { isSelected ? "c-tab s-selected" : "c-tab" } onClick = { ( ) => props . onChoose ( key ) } > { props . optionNamesById [ key ] } < /button>); } ) ; return < div className = "c-tabs" > { buttonElements } < /div>; }