| | |
| | | |
| | | type Option = { |
| | | value: string |
| | | text: string | React.JSX.Element |
| | | text: string | JSX.Element |
| | | } |
| | | |
| | | type ItemProps = { |
| | |
| | | isActive: boolean |
| | | onClick: (v: string) => void |
| | | option: Option |
| | | smallItem?: boolean |
| | | } |
| | | const Item: FC<ItemProps> = ({ |
| | | className, |
| | | isActive, |
| | | onClick, |
| | | option, |
| | | smallItem, |
| | | }) => { |
| | | return ( |
| | | <div |
| | | key={option.value} |
| | | className={cn( |
| | | 'relative pb-2.5 ', |
| | | 'relative pb-2.5 system-xl-semibold', |
| | | !isActive && 'cursor-pointer', |
| | | smallItem ? 'system-sm-semibold-uppercase' : 'system-xl-semibold', |
| | | className, |
| | | )} |
| | | onClick={() => !isActive && onClick(option.value)} |
| | | > |
| | | <div className={cn(isActive ? 'text-text-primary' : 'text-text-tertiary')}>{option.text}</div> |
| | | {isActive && ( |
| | | <div className='absolute bottom-0 left-0 right-0 h-0.5 bg-util-colors-blue-brand-blue-brand-600'></div> |
| | | <div className='absolute bottom-0 left-0 right-0 h-0.5 bg-util-colors-blue-blue-500'></div> |
| | | )} |
| | | </div> |
| | | ) |
| | |
| | | onChange: (v: string) => void |
| | | options: Option[] |
| | | noBorderBottom?: boolean |
| | | smallItem?: boolean |
| | | itemClassName?: string |
| | | } |
| | | |
| | |
| | | options, |
| | | noBorderBottom, |
| | | itemClassName, |
| | | smallItem, |
| | | }) => { |
| | | return ( |
| | | <div className={cn(className, !noBorderBottom && 'border-b border-divider-subtle', 'flex space-x-6')}> |
| | |
| | | onClick={onChange} |
| | | key={option.value} |
| | | className={itemClassName} |
| | | smallItem={smallItem} |
| | | /> |
| | | ))} |
| | | </div> |