// withHooks
// noPage
import esp from 'esoftplay/esp';

import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
import { MarketProduct_listArgs } from 'esoftplay/cache/market/product_list/import';

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


export interface MarketProduct_detail_informationArgs {

}
interface label_data {
  id: string,
  name: string,
  url: string
}

interface cat {
  cat_url: string,
  cat_name: string
}

export interface MarketProduct_detail_informationProps {
  weight: string,
  condition: number,
  minOrder: string,
  category: cat,
  etalase: label_data,
  preorder: number
}
export default function m(props: MarketProduct_detail_informationProps): any {
  const conditionText = ['', esp.lang("market/product_detail_information", "new"), esp.lang("market/product_detail_information", "second")]
  const _preorder = props.preorder || 0

  return (
    <View style={{ marginTop: 15 }}>
      <Text allowFontScaling={false} style={{ marginLeft: 25, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#03192a" }}>{esp.lang("market/product_detail_information", "info_product")}</Text>
      {
        _preorder != 0 &&
        <View style={{ marginTop: 15, marginLeft: 25, marginRight: 25, flexDirection: 'row', justifyContent: 'space-between' }}>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{esp.lang("market/product_detail_information", "preorder_time")}</Text>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{esp.lang("market/product_detail_information", "preorder_days", String(_preorder))}</Text>
        </View>
      }
      {
        props.weight &&
        <View style={{ marginTop: 15, marginLeft: 25, marginRight: 25, flexDirection: 'row', justifyContent: 'space-between' }}>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{esp.lang("market/product_detail_information", "label_weight")}</Text>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{esp.lang("market/product_detail_information", "weight", LibUtils.number(props.weight))}</Text>
        </View>
      }
      {
        props.condition &&
        <View style={{ marginTop: 15, marginLeft: 25, marginRight: 25, flexDirection: 'row', justifyContent: 'space-between' }}>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{esp.lang("market/product_detail_information", "label_consition")}</Text>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{conditionText[props.condition]}</Text>
        </View>
      }
      {
        props.minOrder &&
        <View style={{ marginTop: 15, marginLeft: 25, marginRight: 25, flexDirection: 'row', justifyContent: 'space-between' }}>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{esp.lang("market/product_detail_information", "label_min")}</Text>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{esp.lang("market/product_detail_information", "min", props.minOrder)}</Text>
        </View>
      }
      {
        props.category &&
        <View style={{ marginTop: 15, marginLeft: 25, marginRight: 25, flexDirection: 'row', justifyContent: 'space-between' }}>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{esp.lang("market/product_detail_information", "label_category")}</Text>
          <TouchableOpacity activeOpacity={1} onPress={() => {
            if (props?.category?.cat_url) {
              LibNavigation.navigate<MarketProduct_listArgs>('market/product_list', { url: props?.category?.cat_url, title: props?.category?.cat_name })
            }
          }} >
            <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#724225" }}>{props?.category?.cat_name || esp.lang("market/product_detail_information", "empty_cat")}</Text>
          </TouchableOpacity>
        </View>
      }
      {
        props.etalase &&
        <View style={{ marginTop: 15, marginLeft: 25, marginRight: 25, flexDirection: 'row', justifyContent: 'space-between' }}>
          <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#707070" }}>{esp.lang("market/product_detail_information", "label_display")}</Text>
          <TouchableOpacity activeOpacity={1} onPress={() => {
            if (props?.etalase?.url) {
              LibNavigation.navigate<MarketProduct_listArgs>('market/product_list', { url: props?.etalase?.url, title: props?.etalase?.name })
            }
          }} >
            <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", lineHeight: 13, letterSpacing: 0, textAlign: "left", color: "#724225" }}>{props?.etalase?.name || esp.lang("market/product_detail_information", "empty_display")}</Text>
          </TouchableOpacity>
        </View>
      }

    </View>
  )
}