// withHooks
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
import esp from 'esoftplay/esp';

import { LibUtils } from 'esoftplay/cache/lib/utils/import';
import { MarketHeader } from 'esoftplay/cache/market/header/import';

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


export interface MarketProduct_detail_wholesale_listArgs {
  price_wholesale: any[]
}
export interface MarketProduct_detail_wholesale_listProps {

}

interface wholesaleItem {
  qty_min: number,
  qty_max: number,
  price_unit: number
}

export default function m(props: MarketProduct_detail_wholesale_listProps): any {
  const { price_wholesale } = LibNavigation.getArgsAll<any>(props)
  return (
    <View style={{ flex: 1 }} >
      <MarketHeader onlyBack title={esp.lang("market/product_detail_wholesale_list", "header")} />
      <ScrollView>
        {
          price_wholesale?.map((x: wholesaleItem, i: number) => (
            <View key={i} style={{ padding: 17, borderBottomWidth: 1, borderBottomColor: '#f1f1f1' }}>
              <Text allowFontScaling={false} style={{ fontFamily: 'Arial', fontSize: 14, color: '#606060' }}>{LibUtils.money(x.price_unit)}</Text>
              <Text allowFontScaling={false} style={{ marginTop: 5, fontFamily: 'Arial', fontSize: 11, color: '#606060' }}>{esp.lang("market/product_detail_wholesale_list", "min_order", LibUtils.number(x.qty_min))}</Text>
            </View>
          ))
        }
      </ScrollView>
    </View>)
}