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

import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
import { MarketAds_content_input } from 'esoftplay/cache/market/ads_content_input/import';
import { MarketAds_store_keywordArgs } from 'esoftplay/cache/market/ads_store_keyword/import';
import { MarketButton } from 'esoftplay/cache/market/button/import';
import { MarketHeader } from 'esoftplay/cache/market/header/import';
import { UseForm } from 'esoftplay/cache/use/form/import';

import React from 'react';
import { View } from 'react-native';
import { MarketAds_product_form } from './ads_product_group';


export interface MarketAds_contentArgs {

}
export interface MarketAds_contentProps {

}
export default function m(props: MarketAds_contentProps): any {
  const [form] = UseForm<MarketAds_product_form>('market/ads_register')


  let valid = form?.products?.length > 0 && form?.description?.length > 0

  return (
    <View style={styleId_qpkod}>
      <MarketHeader title={esp.lang("market/ads_content", "header_title")} onlyBack />

      <MarketAds_content_input />

      <View pointerEvents={!valid ? 'none' : 'auto'} style={styleId_Z2mwuu4} >
        <MarketButton onPress={() => {
          LibNavigation.navigate<MarketAds_store_keywordArgs>('market/ads_store_keyword', { cat_ids: form?.products?.map((x: any) => x.cat_id).join(',') })
        }} text={esp.lang("market/ads_content", "btn_next")} buttonStyle={styleId_1vuOTq} colorBackground={valid ? undefined : '#aaa'} />
      </View>

    </View >
  )
}
const styleId_qpkod: any = { flex: 1, backgroundColor: '#fff' }
const styleId_Z2mwuu4: any = { backgroundColor: 'white' }
const styleId_1vuOTq: any = { marginHorizontal: 15, marginVertical: 10 }