import React from 'react';
import { View, StyleSheet, Text } from 'react-native';
import { useTheme } from '../../contexts/theme';
import { testIdWithKey } from '../../utils/testable';
export let InlineErrorType = /*#__PURE__*/function (InlineErrorType) {
  InlineErrorType[InlineErrorType["error"] = 0] = "error";
  InlineErrorType[InlineErrorType["warning"] = 1] = "warning";
  return InlineErrorType;
}({});
const InlineErrorText = ({
  message,
  inlineType,
  config
}) => {
  const {
    InputInlineMessage
  } = useTheme();
  const style = StyleSheet.create({
    container: {
      flexDirection: 'row',
      alignContent: 'center',
      marginVertical: 5,
      paddingRight: 20
    },
    icon: {
      marginRight: 4
    }
  });
  const color = inlineType === InlineErrorType.warning ? InputInlineMessage.inlineWarningText.color : InputInlineMessage.inlineErrorText.color;
  const props = {
    height: 24,
    width: 24,
    color: color,
    style: style.icon
  };
  return /*#__PURE__*/React.createElement(View, {
    style: [style.container, config.style]
  }, inlineType === InlineErrorType.warning ? /*#__PURE__*/React.createElement(InputInlineMessage.InlineWarningIcon, props) : /*#__PURE__*/React.createElement(InputInlineMessage.InlineErrorIcon, props), /*#__PURE__*/React.createElement(Text, {
    style: [InputInlineMessage.inlineErrorText],
    testID: testIdWithKey('InlineErrorText')
  }, message));
};
export default InlineErrorText;
//# sourceMappingURL=InlineErrorText.js.map