"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TextTypeDropdownContent = TextTypeDropdownContent;
exports.TextTypeDropdownContentWrapper = TextTypeDropdownContentWrapper;
var _react = _interopRequireDefault(require("react"));
var _useListboxAttrs = require("../../../hooks/use-listbox-attrs");
var _textTypeDropdownItem = require("./text-type-dropdown-item");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function TextTypeDropdownContentWrapper({
  closeDropdown,
  options,
  selectedKey,
  onSelect
}) {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(TextTypeDropdownContent, {
    options: options,
    onSelect: onSelect,
    selectedKey: selectedKey,
    closeDropdown: closeDropdown
  });
}
function TextTypeDropdownContent({
  options,
  onSelect,
  selectedKey,
  closeDropdown = () => {}
}) {
  const {
    role
  } = (0, _useListboxAttrs.useListboxAttrs)();
  return /*#__PURE__*/(0, _jsxRuntime.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__*/(0, _jsxRuntime.jsx)(_textTypeDropdownItem.TextTypeDropdownItem, {
        index: index,
        option: option,
        selectedKey: selectedKey,
        optionsSize: options.length,
        handleSelect: handleSelect,
        closeDropdown: closeDropdown
      }, option.key);
    })
  });
}