import React from 'react' import classNames from 'classnames' import { useListBoxSection } from 'react-aria' import { Divider } from '~components/Divider' import { type ListSectionProps, type SelectItem } from '../../types' import { ListItem } from '../ListItem' import styles from './ListSection.module.css' export const ListSection = ({ section, state, }: ListSectionProps): JSX.Element => { const { headingProps, itemProps, groupProps } = useListBoxSection({ 'heading': section.rendered, 'aria-label': section['aria-label'], }) const firstSectionHeader = section.key === state.collection.getFirstKey() return ( {!firstSectionHeader &&
  • } {!firstSectionHeader && }
  • {section.rendered && ( {section.rendered} )}
      {Array.from(section.childNodes).map((node) => ( ))}
  • ) }