import {Block, Flex, Text, Press, ScrollView} from './Components' import {RTX} from './constants/constants' interface ListItem { id?: number title?: string } interface ChangeTab { list: ListItem[] current?: number onChange?: Function isScroll?: boolean itemWidth?: string fontSize?: string color?: string selectColor?: string bgColor?: string } const CatLine = (props: ChangeTab) => { const {list, bgColor='#ffffff', hoverColor='#f2f2f2', current=0, onChange=() => {}, isScroll=false, itemWidth, fontSize='32', selectColor='#1890ff', color='#060606'} = props return ( { !isScroll ? { list.length > 0 && list.map((item, index) => ( {onChange(index)}} key={item.id}> { current === index ? {item.title} : {item.title} } )) } : { list.length > 0 && list.map((item, index) => ( {onChange(index)}} key={item.id} hoverBgColor={hoverColor}> { current === index ? {item.title} : {item.title} } )) } } ) } export default CatLine