var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
import { jsx } from "react/jsx-runtime";
import React from "react";
import { TouchableHighlight } from "react-native";
import PropTypes from "prop-types";
import styled, { withTheme } from "styled-components";
const StyledView = styled.View(
  ({
    divided,
    small,
    theme: {
      yoga: {
        components: { list }
      }
    }
  }) => `
  ${divided ? `
          border-bottom-width: ${list.border.width}px;
          border-bottom-color: ${list.border.color};
        ` : ""}

  ${small ? `
          padding:
            ${list.listItem.small.padding.top}px
            ${list.listItem.small.padding.right}px
            ${list.listItem.small.padding.bottom}px
            ${list.listItem.small.padding.left}px;
        ` : `
          padding:
            ${list.listItem.padding.top}px
            ${list.listItem.padding.right}px
            ${list.listItem.padding.bottom}px
            ${list.listItem.padding.left}px;
        `}
  `
);
const ListItem = (_a) => {
  var _b = _a, {
    theme: {
      yoga: {
        components: {
          list: { listItem }
        }
      }
    },
    small = false,
    divided = true,
    onPress = void 0
  } = _b, rest = __objRest(_b, [
    "theme",
    "small",
    "divided",
    "onPress"
  ]);
  const Component = /* @__PURE__ */ jsx(StyledView, __spreadValues({ small, divided }, rest));
  if (onPress) {
    return /* @__PURE__ */ jsx(
      TouchableHighlight,
      {
        onPress,
        underlayColor: listItem.selectable.color,
        children: Component
      }
    );
  }
  return Component;
};
ListItem.propTypes = {
  small: PropTypes.bool,
  divided: PropTypes.bool,
  onPress: PropTypes.func
};
ListItem.displayName = "List.Item";
var ListItem_default = withTheme(ListItem);
export {
  ListItem_default as default
};
