import * as React from 'react'; import { useListBoxSection } from 'react-aria'; import type { Node } from 'react-stately'; import { DataList } from '../../../DataList/DataList'; import type { CommonInputProps } from '../../types'; import type { MultiSelectState } from '../hooks/useMultiSelectState'; import { MultiSelectOption } from './MultiSelectOption'; interface MultiSelectSectionProps extends Pick { section: Node; state: MultiSelectState; mode: 'content' | 'dropdown' | undefined; } export const MultiSelectSection = ({ section, state, error, warning, mode, ...rest }: MultiSelectSectionProps) => { rest satisfies Record; const { itemProps, headingProps, groupProps } = useListBoxSection({ heading: section.rendered, 'aria-label': section['aria-label'], }); return ( <> {section.rendered && {section.rendered}} {[...section.childNodes].map(node => ( ))} ); };