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

import { LibIcon } from 'esoftplay/cache/lib/icon/import';
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
import { MarketProduct_detail_wholesale_listArgs } from 'esoftplay/cache/market/product_detail_wholesale_list/import';

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


export interface MarketProduct_detail_wholesaleArgs {

}
export interface MarketProduct_detail_wholesaleProps {
  price_wholesale: any[]
}

export default function m(props: MarketProduct_detail_wholesaleProps): any {
  const newArr = props?.price_wholesale?.map((item) => Number(item?.price_unit)) || [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" }}>Harga Grosir</Text>
      <TouchableOpacity onPress={() => { LibNavigation.navigate<MarketProduct_detail_wholesale_listArgs>('market/product_detail_wholesale_list', { price_wholesale: props.price_wholesale }) }} style={{ marginTop: 15, marginLeft: 25, marginRight: 25, flexDirection: 'row', alignItems: 'center', 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_wholesale", "start_price", LibUtils.money(Math.min(...newArr)))}</Text>
        <LibIcon name="chevron-right" />
      </TouchableOpacity>
    </View>
  )
}