// withHooks
// noPage

import { LibStyle } from 'esoftplay/cache/lib/style/import';
import esp from 'esoftplay/esp';

import React from 'react';
import { Pressable, Text, TouchableOpacity, View } from 'react-native';


export interface MarketAcceptArgs {

}
export interface MarketAcceptProps {
  onPressAgree: () => void
  agree: boolean
  onPressTerm: () => void
  onPressPrivacy: () => void
  style?: any
  fontColor?: string
}
export default function m(props: MarketAcceptProps): any {
  return (
    <View style={{ margin: 15, marginTop: 0, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
      <Pressable testID='check-agree' onPress={() => { props.onPressAgree() }}>
        <View style={[{ height: 20, width: 20, borderRadius: 2, borderColor: props.agree ? LibStyle.colorPrimary : '#8e8e8e', borderWidth: 1, justifyContent: 'center', alignItems: 'center' }, props.style]} >
          {props.agree && <View style={{ height: 16, width: 16, borderRadius: 2, backgroundColor: props.agree ? props.fontColor ? props.fontColor : LibStyle.colorPrimary : '#8e8e8e' }} />}
        </View>
      </Pressable>
      <View style={{ marginLeft: 10, flexDirection: 'row', flexWrap: 'wrap', alignContent: 'center', alignItems: 'center' }}>
        <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0 }}>{esp.lang("market/accept", "term")}</Text>
        <TouchableOpacity onPress={() => { props.onPressTerm() }}>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", fontWeight: 'bold', color: props.fontColor ? props.fontColor : LibStyle.colorPrimary, letterSpacing: 0 }}>{esp.lang("market/accept", "data")}</Text>
        </TouchableOpacity>
        <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0 }}>{esp.lang("market/accept", "and")}</Text>
        <TouchableOpacity onPress={() => { props.onPressPrivacy() }}>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", fontWeight: 'bold', color: props.fontColor ? props.fontColor : LibStyle.colorPrimary, letterSpacing: 0 }}>{esp.lang("market/accept", "tos")}</Text>
        </TouchableOpacity>
      </View>
    </View>
  )
}