import React, { useEffect, useState } from 'react';
import { StyleSheet } from 'react-native';
import Text from '../text/index.native';
import { useTemplateContext } from '../../template/app-review/template-context';
import Touchable from '../../hoc/touchable/index.native';
const createStyle = (theme, brandTheme) => StyleSheet.create({
  wrapper: {
    backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,
    borderRadius: 7,
    width: '100%'
  },
  text: {
    fontSize: 14,
    lineHeight: 20,
    fontWeight: '700',
    color: theme.colors.white,
    marginBottom: 16,
    marginTop: 16,
    textAlign: 'center'
  }
});
const Button = props => {
  const {
    accessibilityLabel,
    disabled,
    onPress,
    style,
    submitValue,
    testID,
    textStyle
  } = props;
  const {
    theme,
    brandTheme
  } = useTemplateContext();
  const [styleSheet, setStylesheet] = useState();
  useEffect(() => {
    const _style = createStyle(theme, brandTheme);
    setStylesheet(_style);
  }, [theme, brandTheme]);
  if (!styleSheet) return null;
  const _textStyle = {
    ...styleSheet.text,
    ...textStyle
  };
  return /*#__PURE__*/React.createElement(Touchable, {
    testID: testID,
    onPress: onPress,
    disabled: disabled,
    accessibilityLabel: accessibilityLabel,
    style: [styleSheet.wrapper, style]
  }, /*#__PURE__*/React.createElement(Text, {
    style: _textStyle
  }, submitValue));
};
export default Button;
//# sourceMappingURL=index.native.js.map