({
className,
items = plusFeatureList,
...props
}: PlusListProps & WithClassNameProps)
| 315 | ); |
| 316 | |
| 317 | export const PlusList = ({ |
| 318 | className, |
| 319 | items = plusFeatureList, |
| 320 | ...props |
| 321 | }: PlusListProps & WithClassNameProps): ReactElement => { |
| 322 | const { logEvent } = useLogContext(); |
| 323 | |
| 324 | const handleItemHover = (item: PlusItem) => { |
| 325 | logEvent({ |
| 326 | event_name: LogEvent.HoverPlusFeature, |
| 327 | target_id: item.id, |
| 328 | target_type: TargetType.List, |
| 329 | }); |
| 330 | }; |
| 331 | |
| 332 | const handleItemClick = (item: PlusItem) => { |
| 333 | logEvent({ |
| 334 | event_name: LogEvent.ClickPlusFeature, |
| 335 | target_id: item.id, |
| 336 | target_type: TargetType.List, |
| 337 | }); |
| 338 | }; |
| 339 | |
| 340 | return ( |
| 341 | <ul className={classNames('flex flex-col gap-0.5 py-6', className)}> |
| 342 | {items.map((item) => ( |
| 343 | <PlusListItem |
| 344 | key={item.label} |
| 345 | item={item} |
| 346 | typographyProps={item.typographyProps} |
| 347 | onHover={() => handleItemHover(item)} |
| 348 | {...props} |
| 349 | onClick={ |
| 350 | item.href |
| 351 | ? () => { |
| 352 | handleItemClick(item); |
| 353 | props.onClick?.(); |
| 354 | } |
| 355 | : props.onClick |
| 356 | } |
| 357 | /> |
| 358 | ))} |
| 359 | </ul> |
| 360 | ); |
| 361 | }; |
nothing calls this directly
no test coverage detected