function _extends() { _extends = Object.assign || 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, { memo, forwardRef } from 'react';
import Text from '../Text';
import { usePropsResolution } from '../../../hooks/useThemeProps';
import { getThemeProps } from '../../../utils/styled';
import { useColorMode } from '../../../core/color-mode';
import { useNativeBase } from '../../../hooks';
import { useNativeBaseConfig } from '../../../core/NativeBaseContext';
import { Platform } from 'react-native';

const Heading = (props, ref) => {
  var _props$fontFamily, _props$fontWeight, _props$fontStyle;

  //@ts-ignore
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  const {
    size,
    ...resolvedProps
  } = usePropsResolution('Heading', props, {});
  const {
    colorMode
  } = useColorMode();
  const {
    theme
  } = useNativeBase();
  const providerId = useNativeBaseConfig('NativeBase').providerId;
  const {
    styleFromProps
  } = getThemeProps(theme, providerId, 'Heading', {
    colorMode,
    platform: Platform.OS
  });
  return /*#__PURE__*/React.createElement(Text, _extends({}, resolvedProps, {
    ref: ref,
    fontFamily: (_props$fontFamily = props.fontFamily) !== null && _props$fontFamily !== void 0 ? _props$fontFamily : styleFromProps === null || styleFromProps === void 0 ? void 0 : styleFromProps.fontFamily,
    fontWeight: (_props$fontWeight = props.fontWeight) !== null && _props$fontWeight !== void 0 ? _props$fontWeight : styleFromProps === null || styleFromProps === void 0 ? void 0 : styleFromProps.fontWeight,
    fontStyle: (_props$fontStyle = props.fontStyle) !== null && _props$fontStyle !== void 0 ? _props$fontStyle : styleFromProps.fontStyle
  }));
};

export default /*#__PURE__*/memo( /*#__PURE__*/forwardRef(Heading));
//# sourceMappingURL=index.js.map