import { Box, Button, FormControl, FormErrorMessage, FormLabel, HStack, Input, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, Switch, Table, Tbody, Text, Textarea, Th, Tr, } from "@chakra-ui/react"; import DataTable from "../../../../Components/DataTable/DataTable"; import { useState } from "react"; import { AddIcon } from "@chakra-ui/icons"; import { useGetDistributionInvestorMutation } from "../../../../Services/io.service"; import { useParams } from "react-router-dom"; import { useEffect } from "react"; import { Controller, useForm } from "react-hook-form"; import * as yup from "yup"; import { yupResolver } from "@hookform/resolvers/yup"; export const investor = yup.object().shape({ amount: yup.string().required("Amount is required"), }); const DistributionInvestor = ({ isOpen, onClose }) => { const params = useParams(); const id = params?.id; // const { // data:IObyID, // error, // isLoading, // } = useGetDistributionInvestorMutation(id); const [getDistributionInvestment] = useGetDistributionInvestorMutation(); const { control, handleSubmit, formState: { errors }, reset, } = useForm({ resolver: yupResolver(investor), }); // useEffect(()=>{ // try { // const res = getDistributionInvestment({id,data}) // console.log(res); // } catch (error) { // } // },[]) // console.log(IObyID); // ====================================================[Table Setup]================================================================ const tableHeadRow = [ "Sr No.", "Client Id", "First name", "Last Name", "Amount", "%", "($)", ]; const filteredData = [ { id: 1, }, { id: 1, }, { id: 1, }, { id: 1, }, ]; const [extractedArray, setExtractedArray] = useState( filteredData?.map((item, index) => ({ id: item?.id, "Sr No.": ( {index + 1} ), "Client Id": ( BH00000001 ), "First name": ( Faisal ), "Last Name": ( Aljalahma ), Amount: ( $100,000 /- ), "%": ( 26.0 % ), "($)": ( $100,000 /- ), })) ); const Total = () => { return (
Total {" "} {" "} {" "} $100200 100.0% $100230
); }; const onSubmit = (data) => { console.log(data); }; console.log(errors); return ( Distribution To Investor Transaction {/* Amount to Distribute */} {/* */} Amount to Distribute ( )} /> {errors.amount?.message} } // isLoading={isLoading} /> ); }; export default DistributionInvestor;