import React from 'react';
import { useListboxAttrs } from '../../../hooks/use-listbox-attrs';
import { TextTypeDropdownItem } from './text-type-dropdown-item';
import { jsx as _jsx } from "react/jsx-runtime";
export function TextTypeDropdownContentWrapper({
  closeDropdown,
  options,
  selectedKey,
  onSelect
}) {
  return /*#__PURE__*/_jsx(TextTypeDropdownContent, {
    options: options,
    onSelect: onSelect,
    selectedKey: selectedKey,
    closeDropdown: closeDropdown
  });
}
export function TextTypeDropdownContent({
  options,
  onSelect,
  selectedKey,
  closeDropdown = () => {}
}) {
  const {
    role
  } = useListboxAttrs();
  return /*#__PURE__*/_jsx("ul", {
    className: "text-type-dropdown-content",
    "test-id": "text-type-dropdown-content",
    role: role,
    children: options.map((option, index) => {
      const handleSelect = () => onSelect(option);
      return /*#__PURE__*/_jsx(TextTypeDropdownItem, {
        index: index,
        option: option,
        selectedKey: selectedKey,
        optionsSize: options.length,
        handleSelect: handleSelect,
        closeDropdown: closeDropdown
      }, option.key);
    })
  });
}