// withHooks
// noPage
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
import { LibStyle } from 'esoftplay/cache/lib/style/import';
import { LibUtils } from 'esoftplay/cache/lib/utils/import';

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


export interface MarketAds_product_previewArgs {

}
export interface MarketAds_product_previewProps {
  id: string,
  cat_id: string,
  title: string,
  image: string,
  sale: string,
  sale_max: string,
  stocks: string,
  sold: string,
  rating: string,
  rating_value: string,
  rating_count: string,
  publish: string,
  active: string,
  alert: string,
  onDelete: () => void,
  product_name?: string,
  product_image: string
}
export default function m(props: MarketAds_product_previewProps): any {
  return (
    <View style={styleId_13KG4F}>
      <LibPicture source={{ uri: props?.image || props?.product_image }} style={styleId_FYon4} resizeMode="cover" />
      <View style={styleId_14tcJb}>
        <Text allowFontScaling={false} style={styleId_cP8sW} >{props?.title || props?.product_name}</Text>
        {
          props.sale &&
          <Text allowFontScaling={false} style={styleId_1RnloU} >{LibUtils.money(props?.sale)}</Text>
        }
      </View>
      <TouchableOpacity onPress={() => props.onDelete()}>
        <LibIcon name="trash-can-outline" />
      </TouchableOpacity>
    </View>
  )
}
const styleId_13KG4F: any = { flexDirection: 'row', marginHorizontal: 15, padding: 15, alignContent: 'center', alignItems: 'center', marginTop: 10, backgroundColor: 'white', borderRadius: 5, ...LibStyle.elevation(2) }
const styleId_FYon4: any = { borderRadius: 5, height: 60, width: 60 }
const styleId_14tcJb: any = { marginLeft: 10, flex: 1 }
const styleId_cP8sW: any = { fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0 }
const styleId_1RnloU: any = { marginTop: 8, fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#000' }