function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from "react";
import { backgroundColorStyleFunction, colorStyleFunction, layoutStyleFunction, spacingStyleFunction, opacityStyleFunction, visibleStyleFunction } from "../../../theme/src/style-functions";
import { AntDesign, Entypo, EvilIcons, Feather, FontAwesome, FontAwesome5, Fontisto, Foundation, Ionicons, MaterialCommunityIcons, MaterialIcons, Octicons, SimpleLineIcons, Zocial } from "@expo/vector-icons";
import responsiveSize from "../../../utils/responsive-size";
import { pearl } from "../../../pearl";
const iconStyleFunctions = [colorStyleFunction, backgroundColorStyleFunction, spacingStyleFunction, layoutStyleFunction, opacityStyleFunction, visibleStyleFunction];

// BaseIconProps defines the basic properties for the Icon component

// Mapping of icon families to their respective components
const iconFamilyMapping = {
  AntDesign,
  Entypo,
  EvilIcons,
  Feather,
  FontAwesome,
  FontAwesome5,
  Fontisto,
  Foundation,
  Ionicons,
  MaterialCommunityIcons,
  MaterialIcons,
  Octicons,
  SimpleLineIcons,
  Zocial
};

// CustomIcon is a wrapper around the icon components that allows for additional customization
const CustomIcon = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(({
  iconFamily,
  iconName,
  accessibilityLabel = undefined,
  rawSize = undefined,
  ...props
}, ref) => {
  // Select the appropriate icon component based on the iconFamily prop
  const IconToUse = iconFamilyMapping[iconFamily];
  return /*#__PURE__*/React.createElement(IconToUse, _extends({
    accessible: true,
    accessibilityLabel: accessibilityLabel ? accessibilityLabel : `${iconName} Icon`,
    name: iconName
  }, props, {
    ref: ref,
    size: responsiveSize(rawSize)
  }));
}));

/** The `Icon` component can used to add Expo Icons to your app and customize them using style props. */
const Icon = pearl(CustomIcon, {
  componentName: "Icon",
  type: "atom",
  animatable: true
}, iconStyleFunctions);
Icon.displayName = "Icon";
export default Icon;
//# sourceMappingURL=icon.js.map