// withHooks
// noPage

import { LibIcon } from 'esoftplay/cache/lib/icon/import';
import { LibStyle } from 'esoftplay/cache/lib/style/import';
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
import { MarketStyle } from 'esoftplay/cache/market/style/import';

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


export interface MarketChipProps {
  text: string,
  selected: boolean,
  onTextSelect: (x: any) => void
}
export default function m(props: MarketChipProps): any {
  return (
    <TouchableOpacity disabled={props.selected} activeOpacity={1} onPress={() => {
      props.onTextSelect && props.onTextSelect(props.text)
    }} >
      <View style={[styleId_1u3DcB, { backgroundColor: props.selected ? "#FDF1DE" : "white" }]} >
        <LibTextstyle text={props.text} textStyle="footnote" style={{}} />
      </View>
      {
        props.selected &&
        <TouchableOpacity onPress={() => { }} style={styleId_1GaN9K} >
          <LibIcon name="close-box" color={LibStyle.colorRed} size={15} style={styleId_Z2mwuu4} />
        </TouchableOpacity>
      }
    </TouchableOpacity>
  )
}
const styleId_1u3DcB: any = { borderWidth: 1, borderColor: MarketStyle.colorPrimaryMarket, borderRadius: 6, marginRight: 12, paddingHorizontal: 12, paddingVertical: 6, marginTop: 10 }
const styleId_1GaN9K: any = { position: 'absolute', top: 5, right: 5 }
const styleId_Z2mwuu4: any = { backgroundColor: 'white' }