import { Form, Row, Col, Select, Avatar, Spin } from "antd"; import React, { useState, Dispatch, SetStateAction, useEffect } from "react"; import { Link } from "react-router-dom"; import AddButton from "../../components/Button/AddButton"; import CustomInput from "../../components/Input/CustomInput"; import CustomSelect from "../../components/Input/CustomSelect"; import CurrencyImage from "../../components/Currency/CurrencyImage"; import { IPropsSupportedCurrency, PaymentLinkResponseType, } from "../../components/types"; import { useGetCurrencyQuery } from "../../services/checkout-service"; import { skipToken } from "@reduxjs/toolkit/dist/query"; export type ICheckoutProps = { loading: boolean; data: PaymentLinkResponseType; setShowWalletOption: Dispatch>; setTransactionValue: Dispatch>; }; const ProductCheckout = ({ data, loading, setShowWalletOption, setTransactionValue, }: ICheckoutProps) => { const [form] = Form.useForm(); const [currencyType, setCurrencyType] = useState(""); const { data: supportedCurrency, isLoading } = useGetCurrencyQuery( data.businessId ?? skipToken ); const selectedCurrency = (value: string) => { setCurrencyType(value); }; async function onConfirm(values: any) { setShowWalletOption(true); delete values.amount; setTransactionValue(values); } return (
{Boolean(data.isActive) ? (
{data?.imageFilePath && (
)}

{data.name}

{data.description}

{data.environment === "TEST" && (

This business is currently running in test mode, do not send real tokens to the generated wallet address.

)}
} className={currencyType !== "" ? "asPrefix" : ""} onChange={selectedCurrency} placeholder="Select Coin" > <> {supportedCurrency?.map( (currency: IPropsSupportedCurrency, i) => ( {currency.currency} ) )}
Make Payment
{" "}
Powered by Ivorypay

For questions and enquiries, please contact:

support@ivorypay.io
) : (

{" "} Payment Link is Inactive{" "}

)}
); }; export default ProductCheckout;