import { jsx } from "react/jsx-runtime";
import React from "react";
import styled from "styled-components";
import { func, arrayOf, string, shape, number, oneOfType } from "prop-types";
import { TouchableWithoutFeedback } from "react-native";
import Text from "../../Text";
import List from "../../List";
const Option = styled(List.Item)`
  ${({
  isSelected,
  theme: {
    yoga: {
      components: { dropdown }
    }
  }
}) => `
    padding:
      ${dropdown.backdrop.content.option.padding.top}px
      ${dropdown.backdrop.content.option.padding.right}px
      ${dropdown.backdrop.content.option.padding.bottom}px
      ${dropdown.backdrop.content.option.padding.left}px;

    border-bottom-width: ${dropdown.option.border.width}px;
    background-color: ${isSelected ? `${dropdown.hover.option.backgroundColor}` : "transparent"};
  `}
`;
const OptionText = styled(Text.Body2)`
  ${({
  isSelected,
  theme: {
    yoga: {
      components: { dropdown }
    }
  }
}) => `
    font-size: ${dropdown.option.font.size}px;
    line-height: ${dropdown.option.font.lineHeight}px;
    color: ${isSelected ? `${dropdown.selected.option.font.color}` : `${dropdown.option.font.color}`};
  `}
`;
const Options = ({ options, selectedOption = null, onSelect = () => {
} }) => /* @__PURE__ */ jsx(
  List,
  {
    style: { height: 60 * 3.6 },
    data: options.map((item) => item),
    keyExtractor: (_, index) => index.toString(),
    renderItem: ({ item }) => /* @__PURE__ */ jsx(TouchableWithoutFeedback, { onPress: () => onSelect(item), children: /* @__PURE__ */ jsx(
      Option,
      {
        isSelected: selectedOption && selectedOption.value === item.value,
        children: /* @__PURE__ */ jsx(
          OptionText,
          {
            isSelected: selectedOption && selectedOption.value === item.value,
            bold: selectedOption && selectedOption.value === item.value,
            children: item.label
          }
        )
      },
      item.value
    ) })
  }
);
const optionShape = {
  label: string,
  value: oneOfType([string, number])
};
Options.propTypes = {
  options: arrayOf(shape(optionShape)).isRequired,
  selectedOption: shape(optionShape),
  onSelect: func
};
var Options_android_default = Options;
export {
  Options_android_default as default
};
