// withHooks

import { LibPicture } from 'esoftplay/cache/lib/picture/import';
import esp from 'esoftplay/esp';
import React from 'react';
import { Pressable, Text, View } from 'react-native';


export interface EventButtonArgs {

}
export interface EventButtonProps {
  icon?: string,
  label: string,
  style?: any,
  fontColor?: string,
  borderColor?: string,
  backgroundColor?: string,
  testID?: any
  onPress: () => void
}
export default function m(props: EventButtonProps): any {
  return (
    <View>
      <Pressable testID={props.testID} onPress={() => props.onPress()} style={{ minWidth: '100%', alignSelf: 'center' }}  >
        {
          props.icon ?
            <View style={[{ borderWidth: 1, borderColor: props.borderColor ? props.borderColor : 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 5, backgroundColor: props.backgroundColor || "#6c432c", flexDirection: 'row', alignItems: 'center', paddingHorizontal: 9 }, props.style]} >
              <LibPicture source={esp.assets(props.icon)} style={{ width: 18, height: 18, resizeMode: 'contain' }} />
              <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: 'white', flex: 1, marginRight: 30, marginLeft: 10 }} >{props.label}</Text>
            </View>
            :
            <View style={[{ borderWidth: 1, borderColor: props.borderColor ? props.borderColor : 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 5, backgroundColor: props.backgroundColor || "#6c432c", justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }, props.style]} >
              <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: props.fontColor ? props.fontColor : 'white', marginRight: 10, marginLeft: 10 }} >{props.label}</Text>
            </View>
        }
      </Pressable>
    </View>
  )
}