// withHooks
// noPage

import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';

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


export interface MarketSection_menuProps {
  title?: string,
  size?: "line" | "small" | "default",
  smooth?: boolean,
  footer?: boolean,
  rightText?: string,
  rightView?: any,
  rightOnPress?: () => void
  mandatory?: boolean,
  mandatoryColor?: string
}
export default function m(props: MarketSection_menuProps): any {
  const size = props.size || "default"
  const smooth = props.smooth
  if (size == 'line') {
    return <View style={{ height: 1, backgroundColor: "#f5f5f5" }} />
  }
  return (
    <View style={{ backgroundColor: smooth ? "transparent" : "#f5f5f5", paddingHorizontal: 17, paddingTop: props.footer ? 3 : 12, paddingBottom: props.footer ? 12 : 5, height: size == 'small' ? 10 : undefined, borderTopWidth: 1, borderTopColor: smooth ? "transparent" : "#eee", borderBottomWidth: 1, borderBottomColor: smooth ? "transparent" : "#eee", flexDirection: "row" }} >
      {
        size == 'default' &&
        <View style={{ flexDirection: 'row', alignItems: 'center', flex: 1 }} >
          <LibTextstyle text={props.title || ''} textStyle={props.footer ? "caption2" : "footnote"} style={{ fontSize: 12, fontWeight: "bold", lineHeight: 13, textAlign: "left", color: "#03192a", fontFamily: 'ArialBold' }} />
          {props.mandatory && <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: props.mandatoryColor ? props.mandatoryColor : "#d0021b", marginBottom: 8 }}> *</Text>}
        </View>
      }
      {props.rightView ? props.rightView : props.rightText ? <TouchableOpacity disabled={!props.rightOnPress} onPress={props.rightOnPress}><LibTextstyle text={props.rightText || ''} textStyle={"footnote"} style={{ color: "#888", textAlign: "right" }} /></TouchableOpacity> : null}
    </View>
  )
}