import React, { useState, useEffect } from 'react';
import { StyleSheet } from 'react-native';
import Text from '../../../atom/text/index.native';
import Touchable from '../../touchable/index.native';
import { useTemplateContext } from '../../../template/app-review/template-context';
const createStyleSheet = (brandTheme, theme) => StyleSheet.create({
  container: {
    backgroundColor: theme.colors.white,
    padding: theme.spacing.small
  },
  text: {
    fontWeight: theme.fontWeight.bold,
    color: theme.colors.black
  },
  selectedTextStyle: {
    color: brandTheme?.colors?.primary
  }
});
const ModalSelectItem = props => {
  const templateContext = useTemplateContext();
  const [styleSheet, setStylesheet] = useState(null);
  const {
    brandTheme,
    theme
  } = templateContext;
  useEffect(() => {
    const _stylesheet = createStyleSheet(brandTheme, theme);
    setStylesheet(_stylesheet);
  }, [theme, brandTheme]);
  if (!styleSheet) {
    return null;
  }
  const {
    children,
    onPress,
    isSelected,
    testID
  } = props;
  let textStyle = styleSheet.text;
  if (isSelected) {
    textStyle = {
      ...textStyle,
      ...styleSheet.selectedTextStyle
    };
  }
  return /*#__PURE__*/React.createElement(Touchable, {
    onPress: onPress,
    style: styleSheet.container,
    testID: testID
  }, /*#__PURE__*/React.createElement(Text, {
    style: textStyle
  }, children));
};
export default ModalSelectItem;
//# sourceMappingURL=index.native.js.map