(props: ComboBoxItemProps)
| 467 | } as const; |
| 468 | |
| 469 | export function ComboBoxItem(props: ComboBoxItemProps): ReactNode { |
| 470 | let ref = useRef(null); |
| 471 | let isLink = props.href != null; |
| 472 | let {size} = useContext(InternalComboboxContext); |
| 473 | // oxlint-disable react/react-compiler |
| 474 | return ( |
| 475 | <ListBoxItem |
| 476 | {...props} |
| 477 | ref={ref} |
| 478 | textValue={ |
| 479 | props.textValue || |
| 480 | (typeof props.children === 'string' ? (props.children as string) : undefined) |
| 481 | } |
| 482 | style={pressScale(ref, props.UNSAFE_style)} |
| 483 | className={renderProps => |
| 484 | (props.UNSAFE_className || '') + listboxItem({...renderProps, size, isLink}, props.styles) |
| 485 | }> |
| 486 | {renderProps => { |
| 487 | let {children} = props; |
| 488 | return ( |
| 489 | <> |
| 490 | <Provider |
| 491 | values={[ |
| 492 | [ |
| 493 | IconContext, |
| 494 | { |
| 495 | slots: { |
| 496 | icon: { |
| 497 | render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), |
| 498 | styles: icon |
| 499 | } |
| 500 | } |
| 501 | } |
| 502 | ], |
| 503 | [ |
| 504 | AvatarContext, |
| 505 | { |
| 506 | slots: { |
| 507 | avatar: {size: avatarSize[size], styles: avatar} |
| 508 | } |
| 509 | } |
| 510 | ], |
| 511 | [ |
| 512 | TextContext, |
| 513 | { |
| 514 | slots: { |
| 515 | label: {styles: label({size})}, |
| 516 | description: {styles: description({...renderProps, size})} |
| 517 | } |
| 518 | } |
| 519 | ] |
| 520 | ]}> |
| 521 | {!isLink && !props.onAction && ( |
| 522 | <CheckmarkIcon |
| 523 | size={checkmarkIconSize[size]} |
| 524 | className={checkmark({...renderProps, size})} |
| 525 | /> |
| 526 | )} |
nothing calls this directly
no test coverage detected