// withHooks
// noPage

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

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

export interface MarketInput_selectProps {
  label?: string,
  style?: any,
  containerStyle?: any,
  onPress: () => void,
  value?: string,
  placeholder?: string,
  mandatory?: boolean,
  mandatoryColor?: string
  testID?: string
}
export default function m(props: MarketInput_selectProps): any {
  return (
    <View style={{ paddingHorizontal: 17, marginTop: 4, marginBottom: 8, ...props.containerStyle }} >
      {props.label && <MarketInput_label label={props.label} mandatory={props.mandatory} mandatoryColor={props.mandatoryColor} />}
      <TouchableOpacity testID={props?.testID || 'select'} onPress={props.onPress} style={{ paddingVertical: 9, borderWidth: 1, borderRadius: 6, alignItems: "center", borderColor: "#ddd", flexDirection: 'row', paddingHorizontal: 10, ...props.style }} >
        <LibTextstyle
          numberOfLines={1}
          ellipsizeMode="middle"
          textStyle="callout" text={props.value || props.placeholder || " "} style={{ flex: 1, fontSize: 14, color: !props.value ? "#888" : "#000" }} />
        <LibIcon.SimpleLineIcons name="arrow-right" size={15} color={MarketStyle.colorPrimaryMarket} style={{ fontWeight: "bold" }} />
      </TouchableOpacity>
    </View>
  )
}