You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

item.tsx 643B

123456789101112131415161718192021222324252627282930313233
  1. import React from 'react'
  2. import cn from '@/utils/classnames'
  3. type ItemProps = {
  4. isActive: boolean
  5. label: string
  6. onClick: () => void
  7. }
  8. const Item = ({
  9. isActive,
  10. label,
  11. onClick,
  12. }: ItemProps) => {
  13. return (
  14. <div
  15. className={cn(
  16. 'system-md-semibold relative flex h-full cursor-pointer items-center text-text-tertiary',
  17. isActive && 'text-text-primary',
  18. )}
  19. onClick={onClick}
  20. >
  21. {label}
  22. {
  23. isActive && (
  24. <div className='absolute bottom-0 h-0.5 w-full bg-util-colors-blue-brand-blue-brand-600' />
  25. )
  26. }
  27. </div>
  28. )
  29. }
  30. export default React.memo(Item)