({
badgeProps,
iconProps,
icon: Icon = VIcon,
item,
typographyProps,
onHover,
onClick,
}: PlusListItemProps)
| 52 | } |
| 53 | |
| 54 | export const PlusListItem = ({ |
| 55 | badgeProps, |
| 56 | iconProps, |
| 57 | icon: Icon = VIcon, |
| 58 | item, |
| 59 | typographyProps, |
| 60 | onHover, |
| 61 | onClick, |
| 62 | }: PlusListItemProps): ReactElement => { |
| 63 | if (item.href) { |
| 64 | return ( |
| 65 | <li |
| 66 | className="-mx-1 flex gap-1 rounded-6 p-1 hover:bg-surface-float" |
| 67 | onMouseEnter={onHover} |
| 68 | > |
| 69 | <Typography |
| 70 | type={TypographyType.Body} |
| 71 | color={TypographyColor.Tertiary} |
| 72 | {...typographyProps} |
| 73 | tag={TypographyTag.Link} |
| 74 | href={item.href} |
| 75 | target="_blank" |
| 76 | rel={anchorDefaultRel} |
| 77 | onClick={onClick} |
| 78 | className={classNames( |
| 79 | '-mt-px flex flex-1 flex-wrap items-baseline underline', |
| 80 | typographyProps?.className, |
| 81 | )} |
| 82 | > |
| 83 | {item.label} |
| 84 | </Typography> |
| 85 | </li> |
| 86 | ); |
| 87 | } |
| 88 | |
| 89 | return ( |
| 90 | <ConditionalWrapper |
| 91 | condition={!!item.tooltip} |
| 92 | // Global on purpose: the old `!tablet:max-w-72` was dead (Tailwind's |
| 93 | // important prefix goes after the variant), leaving `!max-w-full` to |
| 94 | // un-cap the tooltip to the viewport on every Plus surface. |
| 95 | wrapper={(component: ReactNode) => ( |
| 96 | <Tooltip |
| 97 | className="text-center" |
| 98 | content={item.tooltip} |
| 99 | delayDuration={0} |
| 100 | enableMobileClick |
| 101 | > |
| 102 | {component} |
| 103 | </Tooltip> |
| 104 | )} |
| 105 | > |
| 106 | <li |
| 107 | className={classNames( |
| 108 | '-mx-1 flex gap-1 rounded-6 p-1', |
| 109 | !!item.tooltip && 'hover:bg-surface-float', |
| 110 | )} |
| 111 | onMouseEnter={onHover} |
nothing calls this directly
no outgoing calls
no test coverage detected