import React from 'react' import type { Node } from '@react-types/shared' import { useListBox } from 'react-aria' import { type ListProps, type SelectItem } from '../../types' import { ListItem } from '../ListItem' import { ListSection } from '../ListSection' import styles from './List.module.css' export const List = ({ state, listBoxOptions, listBoxRef, }: ListProps): JSX.Element => { const { listBoxProps } = useListBox({ ...listBoxOptions, autoFocus: 'first' }, state, listBoxRef) const renderNode = (node: Node): JSX.Element | null => { if (node.type === 'section') { return node.rendered ? ( ) : null } else { const { selectedIcon, selectedPosition, className } = node.props return ( ) } } return (
    {Array.from(state.collection).map(renderNode)}
) }