From a944303707a83c49f6a96bdf96165dcfddcf605a Mon Sep 17 00:00:00 2001
From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com>
Date: Mon, 15 Jul 2024 12:19:45 +0530
Subject: [PATCH] withdrawal table
---
src/Contexts/GlobalStateProvider.jsx | 309 ++++++------------
src/Pages/Admin/BankInvestor.jsx | 57 +++-
src/Pages/Deposit/DepositHistory.jsx | 272 ---------------
src/Pages/Deposit/DepositRequest.jsx | 19 +-
.../DepositViewHistory/ConfirmModal.jsx | 128 ++++++++
.../DepositViewHistory/DepositHistory.jsx | 307 +++++++++++++++++
.../DepositViewHistory/RejectModal.jsx | 99 ++++++
.../CreateIO/InvestmentDocument.jsx | 3 +-
.../InvestorDetails/InvestorDetails.jsx | 63 +---
.../InvestorDetails/ProfileView.jsx | 62 +++-
.../InvestorDetails/ViewInvestorDetails.jsx | 26 +-
.../WithDrawal/DrawalView/ConfirmModal.jsx | 95 ++++++
.../WithDrawal/DrawalView/RejectModal.jsx | 100 ++++++
.../WithDrawal/DrawalView/ViewHistory.jsx | 274 ++++++++++++++++
src/Pages/WithDrawal/PendingRequest.jsx | 247 ++++++++------
src/Pages/WithDrawal/ViewHistory.jsx | 220 -------------
src/Routes/Routes.js | 6 +-
17 files changed, 1375 insertions(+), 912 deletions(-)
delete mode 100644 src/Pages/Deposit/DepositHistory.jsx
create mode 100644 src/Pages/Deposit/DepositViewHistory/ConfirmModal.jsx
create mode 100644 src/Pages/Deposit/DepositViewHistory/DepositHistory.jsx
create mode 100644 src/Pages/Deposit/DepositViewHistory/RejectModal.jsx
create mode 100644 src/Pages/WithDrawal/DrawalView/ConfirmModal.jsx
create mode 100644 src/Pages/WithDrawal/DrawalView/RejectModal.jsx
create mode 100644 src/Pages/WithDrawal/DrawalView/ViewHistory.jsx
delete mode 100644 src/Pages/WithDrawal/ViewHistory.jsx
diff --git a/src/Contexts/GlobalStateProvider.jsx b/src/Contexts/GlobalStateProvider.jsx
index 2b8d04c..b8a573d 100644
--- a/src/Contexts/GlobalStateProvider.jsx
+++ b/src/Contexts/GlobalStateProvider.jsx
@@ -756,6 +756,7 @@ const GlobalStateProvider = ({ children }) => {
const [InvestorDetails, setInvestorDetails] = useState([
{
id: 1,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -773,6 +774,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 2,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -790,6 +792,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 3,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -807,6 +810,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 4,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -824,6 +828,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 5,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -841,6 +846,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 6,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -858,6 +864,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 7,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -875,6 +882,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 8,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -892,6 +900,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 9,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -909,6 +918,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 10,
+ clientId:"SA00000001",
fullName:"John David",
firstName:"John",
lastName: "David",
@@ -930,7 +940,7 @@ const GlobalStateProvider = ({ children }) => {
{
id: 1,
dealId:"UWE3424992",
- dealId: "KKR Private Equity Fund",
+ dealName: "KKR Private Equity Fund",
sponsorName: "KKR",
investAmount: "$100,000",
holdingPeriod: "4-5 years",
@@ -940,7 +950,7 @@ const GlobalStateProvider = ({ children }) => {
{
id: 2,
dealId:"UWE3424992",
- dealId: "Blackstone Real Estate Income Trust",
+ dealName: "Blackstone Real Estate Income Trust",
sponsorName: "Blackstone",
investAmount: "$100,000",
holdingPeriod: "4-5 years",
@@ -950,7 +960,7 @@ const GlobalStateProvider = ({ children }) => {
{
id: 3,
dealId:"UWE3424992",
- dealId: "J.P. Morgan",
+ dealName: "J.P. Morgan",
sponsorName: "J.P. Morgan",
investAmount: "$100,000",
holdingPeriod: "4-5 years",
@@ -989,224 +999,109 @@ const GlobalStateProvider = ({ children }) => {
Action: "Distribute",
},
]);
+
const [pendingRequest, setPendingRequest] = useState([
{
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
+ id: 1,
+ date:"02-Jan-2024",
+ clientId: "SA00000001",
+ firstName: "John",
+ lastName: "David",
+ country: "Saudi Arabia",
+ phoneNumber: "8940035906",
+ currency: "SAR",
+ withDrawalAmount: "$100,000",
+ amountcurrency:"382574.17",
},
{
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
+ id: 2,
+ date:"02-Jan-2024",
+ clientId: "KU00000001",
+ firstName: "Faisal",
+ lastName: "Aljalahma",
+ country: "Kuwait",
+ phoneNumber: "8226278945",
+ currency: "KWD",
+ withDrawalAmount: "$200,000",
+ amountcurrency:"62438.98",
},
{
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
+ id: 3,
+ date:"02-Jan-2024",
+ clientId: "BH00000001",
+ firstName: "Nawaf",
+ lastName: "Almaskati",
+ country: "Bahrain",
+ phoneNumber: "8940035906",
+ currency: "BHD",
+ withDrawalAmount: "$300,000",
+ amountcurrency:"115328.04",
},
{
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: getRandomDate(startDate, endDate),
- Distribution: "lorem ipsum dummy text",
- charge: "500",
- year: "2024",
- quater: "Q 1",
- amount: 1000,
+ id: 4,
+ date:"02-Jan-2024",
+ clientId: "SA00000002",
+ firstName: "Sulaiman",
+ lastName: "AlBassam",
+ country: "Saudi Arabia",
+ phoneNumber: "8226278945",
+ currency: "SAR",
+ withDrawalAmount: "$400,000",
+ amountcurrency:"1530296.67",
},
]);
const [viewHistory, setViewHistory] = useState([
{
- id: uuidv4(),
- date: "2024-01-15",
- Distribution: "Office supplies",
- charge: "200.50",
- year: "2024",
- quarter: "Q1",
- amount: 1500,
+ id: 1,
+ date:"02-Jan-2024",
+ clientId: "SA00000001",
+ firstName: "John",
+ lastName: "David",
+ country: "Saudi Arabia",
+ phoneNumber: "8940035906",
+ currency: "SAR",
+ withDrawalAmount: "$100,000",
+ amountcurrency:"382574.17",
+ status:"Approved",
},
{
- id: uuidv4(),
- date: "2024-02-10",
- Distribution: "Marketing expenses",
- charge: "450.00",
- year: "2024",
- quarter: "Q1",
- amount: 2000,
+ id: 2,
+ date:"02-Jan-2024",
+ clientId: "KU00000001",
+ firstName: "Faisal",
+ lastName: "Aljalahma",
+ country: "Kuwait",
+ phoneNumber: "8226278945",
+ currency: "KWD",
+ withDrawalAmount: "$200,000",
+ amountcurrency:"62438.98",
+ status:"Rejected",
},
{
- id: uuidv4(),
- date: "2024-03-05",
- Distribution: "Software subscription",
- charge: "300.75",
- year: "2024",
- quarter: "Q1",
- amount: 1200,
+ id: 3,
+ date:"02-Jan-2024",
+ clientId: "BH00000001",
+ firstName: "Nawaf",
+ lastName: "Almaskati",
+ country: "Bahrain",
+ phoneNumber: "8940035906",
+ currency: "BHD",
+ withDrawalAmount: "$300,000",
+ amountcurrency:"115328.04",
+ status:"Approved",
},
{
- id: uuidv4(),
- date: "2024-04-18",
- Distribution: "Travel expenses",
- charge: "600.30",
- year: "2024",
- quarter: "Q2",
- amount: 2500,
- },
- {
- id: uuidv4(),
- date: "2024-05-22",
- Distribution: "Consulting fees",
- charge: "800.00",
- year: "2024",
- quarter: "Q2",
- amount: 3000,
- },
- {
- id: uuidv4(),
- date: "2024-06-14",
- Distribution: "Office rent",
- charge: "1200.25",
- year: "2024",
- quarter: "Q2",
- amount: 3500,
- },
- {
- id: uuidv4(),
- date: "2024-07-09",
- Distribution: "Utilities",
- charge: "150.40",
- year: "2024",
- quarter: "Q3",
- amount: 1000,
- },
- {
- id: uuidv4(),
- date: "2024-08-29",
- Distribution: "Employee training",
- charge: "500.00",
- year: "2024",
- quarter: "Q3",
- amount: 1800,
- },
- {
- id: uuidv4(),
- date: "2024-09-13",
- Distribution: "Website maintenance",
- charge: "350.65",
- year: "2024",
- quarter: "Q3",
- amount: 1400,
- },
- {
- id: uuidv4(),
- date: "2024-10-23",
- Distribution: "Advertising",
- charge: "900.50",
- year: "2024",
- quarter: "Q4",
- amount: 2200,
- },
- {
- id: uuidv4(),
- date: "2024-10-23",
- Distribution: "Advertising",
- charge: "900.50",
- year: "2024",
- quarter: "Q4",
- amount: 2200,
- },
- {
- id: uuidv4(),
- date: "2024-10-23",
- Distribution: "Advertising",
- charge: "900.50",
- year: "2024",
- quarter: "Q4",
- amount: 2200,
+ id: 4,
+ date:"02-Jan-2024",
+ clientId: "SA00000002",
+ firstName: "Sulaiman",
+ lastName: "AlBassam",
+ country: "Saudi Arabia",
+ phoneNumber: "8226278945",
+ currency: "SAR",
+ withDrawalAmount: "$400,000",
+ amountcurrency:"1530296.67",
+ status:"Rejected",
},
]);
const [upgradeHistory, setUpgradeHistory] = useState([
@@ -1766,6 +1661,7 @@ const GlobalStateProvider = ({ children }) => {
const [depositRequest, setDepositRequest] = useState([
{
id: 1,
+ date:"02-Jan-2024",
clientId: "SA00000001",
firstName: "John",
lastName: "David",
@@ -1779,6 +1675,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 2,
+ date:"02-Jan-2024",
clientId: "KU00000001",
firstName: "Faisal",
lastName: "Aljalahma",
@@ -1792,6 +1689,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 3,
+ date:"02-Jan-2024",
clientId: "BH00000001",
firstName: "Nawaf",
lastName: "Almaskati",
@@ -1805,6 +1703,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 4,
+ date:"02-Jan-2024",
clientId: "SA00000002",
firstName: "Sulaiman",
lastName: "AlBassam",
@@ -1821,6 +1720,7 @@ const GlobalStateProvider = ({ children }) => {
const [depositHistory, setDepositHistory] = useState([
{
id: 1,
+ date:"02-Jan-2024",
clientId: "SA00000001",
firstName: "John",
lastName: "David",
@@ -1835,6 +1735,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 2,
+ date:"02-Jan-2024",
clientId: "KU00000001",
firstName: "Faisal",
lastName: "Aljalahma",
@@ -1849,6 +1750,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 3,
+ date:"02-Jan-2024",
clientId: "BH00000001",
firstName: "Nawaf",
lastName: "Almaskati",
@@ -1863,6 +1765,7 @@ const GlobalStateProvider = ({ children }) => {
},
{
id: 4,
+ date:"02-Jan-2024",
clientId: "SA00000002",
firstName: "Sulaiman",
lastName: "AlBassam",
diff --git a/src/Pages/Admin/BankInvestor.jsx b/src/Pages/Admin/BankInvestor.jsx
index f2045d2..cde3502 100644
--- a/src/Pages/Admin/BankInvestor.jsx
+++ b/src/Pages/Admin/BankInvestor.jsx
@@ -1,22 +1,43 @@
-import { Box, Image, Text } from "@chakra-ui/react"
+import { Box, HStack, Image, Input, Text } from "@chakra-ui/react";
// import error from "../assets/Error.svg"
-import robot from "../../assets/robot.png"
+import robot from "../../assets/robot.png";
+import { OPACITY_ON_LOAD } from "../../Layout/animations";
+import { useState } from "react";
+import Pagination from "../../Components/Pagination";
// import robot from "../assets/robot.png"
const BankInvestor = () => {
- return (
-
-
-
- {/* The requested URL was not found on this server. */}
-
- )
-}
+ const [searchTerm, setSearchTerm] = useState("");
-export default BankInvestor
\ No newline at end of file
+ return (
+
+
+
+ setSearchTerm(e.target.value)}
+ >
+ {/*
+
+ */}
+
+
+
+
+ );
+};
+
+export default BankInvestor;
diff --git a/src/Pages/Deposit/DepositHistory.jsx b/src/Pages/Deposit/DepositHistory.jsx
deleted file mode 100644
index afea25b..0000000
--- a/src/Pages/Deposit/DepositHistory.jsx
+++ /dev/null
@@ -1,272 +0,0 @@
-import {
- Badge,
- Box,
- Button,
- HStack,
- Input,
- Switch,
- Text,
- Tooltip,
- useToast,
- } from "@chakra-ui/react";
- import React, { useContext, useEffect, useState } from "react";
- import { HiDotsVertical } from "react-icons/hi";
- import { Link, Link as RouterLink, useNavigate } from "react-router-dom";
- import {
- AddIcon,
- CheckIcon,
- CloseIcon,
- DeleteIcon,
- EditIcon,
- ViewIcon,
- } from "@chakra-ui/icons";
- // import { debounce } from "./AddInvestmentType";
- import { debounce } from "../Master/Sponser/AddSponser";
- import { OPACITY_ON_LOAD } from "../../Layout/animations";
- import Pagination from "../../Components/Pagination";
- import GlobalStateContext from "../../Contexts/GlobalStateContext";
- import CustomAlertDialog from "../../Components/CustomAlertDialog";
- import ToastBox from "../../Components/ToastBox";
- import DataTable from "../../Components/DataTable/DataTable";
-
- const formatDate = (date) => new Date(date).toLocaleDateString(); // Simple date formatter
-
- const DepositHistory = () => {
- const navigate = useNavigate();
- const toast = useToast();
- const { depositHistory, setDepositHistory, slideFromRight } =
- useContext(GlobalStateContext);
- const [searchTerm, setSearchTerm] = useState("");
- const [isLoading, setIsLoading] = useState(true);
- const [deleteAlert, setDeleteAlert] = useState(false);
- const [actionId, setActionId] = useState(false);
- const [mouseEntered, setMouseEntered] = useState(false);
- const [mouseEnteredId, setMouseEnteredId] = useState("");
-
- useEffect(() => {
- // Simulate loading
- const timer = setTimeout(() => {
- setIsLoading(false);
- }, 1500);
-
- // Cleanup the timer on component unmount
- return () => clearTimeout(timer);
- }, []);
-
- // ====================================================[Table Setup]================================================================
- const tableHeadRow = [
- "Sr.no",
- "Client ID",
- "First Name",
- "Last Name",
- "Country",
- "Phone Number",
- "Currency",
- "Deposit Amount",
- "Fees",
- "Total Amount",
- "Amount in Investor currency",
- "Status",
- ];
-
- const handleUpdateStatus = debounce((id) => {
- setDepositHistory((prevDepositHistory) =>
- prevDepositHistory.map((depositHistory) =>
- depositHistory.id === id
- ? { ...depositHistory, status: !depositHistory.status }
- : depositHistory
- )
- );
- toast({
- render: () => ,
- });
- }, 300);
-
- // ====================================================[Table Filter]================================================================
- const filteredData = depositHistory.filter((item) => {
- // Filter by name (case insensitive)
- const name = item.clientId;
- const searchLower = searchTerm.toLowerCase();
- const nameMatches = name.toLowerCase().includes(searchLower);
-
- // Filter by status
- // const status = item.status;
- // const statusLower = status ? "active" : "inactive";
-
- // const statusMatches =
- // statusFilter === "all" ||
- // (statusFilter === "active" && status === true) ||
- // (statusFilter === "inactive" && status === false);
-
- return nameMatches;
- });
-
- const [extractedArray, setExtractedArray] = useState(
- filteredData?.map((item, index) => ({
- // id: item?.id,
- "Sr.no": (
-
- {index + 1}
-
- ),
- "Client ID": (
-
- {item.clientId}
-
- ),
- "First Name": (
-
-
- {item.firstName}
-
-
- ),
- "Last Name": (
-
-
- {item.lastName}
-
-
- ),
- Country: (
-
-
- {item.country}
-
-
- ),
- "Phone Number": (
-
-
- {item.phoneNumber}
-
-
- ),
- Currency: (
-
-
- {item.currency}
-
-
- ),
- "Deposit Amount": (
-
-
- {item.depositAmount}
-
-
- ),
- Fees: (
-
-
- {item.fees}
-
-
- ),
- "Total Amount": (
-
-
- {item.totalAmount}
-
-
- ),
- "Amount in Investor currency": (
-
-
- {item.amountcurrency}
-
-
- ),
- Status: (
-
-
- {item.status}
-
-
- ),
- }))
- );
-
- const handleDelete = () => {
- const IOtype = investmentType.filter(
- (investmentType) => investmentType.id !== actionId
- );
-
- setTimeout(() => {
- setInvestmentType(IOtype);
- setDeleteAlert(false);
- setIsLoading(false);
- }, 100);
- setIsLoading(true);
- };
-
- return (
-
-
-
- setSearchTerm(e.target.value)}
- />
-
-
-
-
-
-
-
-
-
- setDeleteAlert(false)}
- isOpen={deleteAlert}
- message={"Are you sure you want to delete sponers?"}
- alertHandler={handleDelete}
- isLoading={isLoading}
- />
-
- );
- };
-
- export default DepositHistory;
-
\ No newline at end of file
diff --git a/src/Pages/Deposit/DepositRequest.jsx b/src/Pages/Deposit/DepositRequest.jsx
index b165697..882d5d7 100644
--- a/src/Pages/Deposit/DepositRequest.jsx
+++ b/src/Pages/Deposit/DepositRequest.jsx
@@ -56,6 +56,7 @@ const DepositRequest = () => {
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr.no",
+ "Date",
"Client ID",
"First Name",
"Last Name",
@@ -116,6 +117,18 @@ const DepositRequest = () => {
{index + 1}
),
+ "Date": (
+
+ {item.date}
+
+ ),
"Client ID": (
{
{
px={2}
py={1}
>
- Approve
+
{
px={2}
py={1}
>
- Reject
+
diff --git a/src/Pages/Deposit/DepositViewHistory/ConfirmModal.jsx b/src/Pages/Deposit/DepositViewHistory/ConfirmModal.jsx
new file mode 100644
index 0000000..d2b854f
--- /dev/null
+++ b/src/Pages/Deposit/DepositViewHistory/ConfirmModal.jsx
@@ -0,0 +1,128 @@
+import {
+ Box,
+ Button,
+ FormControl,
+ FormLabel,
+ Input,
+ Modal,
+ ModalBody,
+ ModalCloseButton,
+ ModalContent,
+ ModalFooter,
+ ModalHeader,
+ ModalOverlay,
+ Text,
+ useDisclosure,
+} from "@chakra-ui/react";
+import React from "react";
+import * as yup from "yup";
+import { yupResolver } from "@hookform/resolvers/yup";
+import { useForm } from "react-hook-form";
+
+export const conformModalSchema = yup.object().shape({
+ fees: yup.string().required("File name is required"),
+ totalAmount: yup.string().required("File name is required"),
+});
+
+const ConfirmModal = ({ isOpen, onClose, firstField }) => {
+ const {
+ register,
+ handleSubmit,
+ formState: { errors },
+ } = useForm({
+ resolver: yupResolver(conformModalSchema),
+ });
+
+ const onSubmit = (data) => {
+ console.log(data);
+ setFile(data.document[0]);
+
+ const newDocument = {
+ ...data,
+ document: data.document[0].name, // Store the document name
+ status: true,
+ id: uuidv4(),
+ createdAt: new Date().toISOString(),
+ Type: getFileIcon(file.type),
+ };
+
+ setCreate((prevCreate) => [...prevCreate, newDocument]);
+ onClose();
+ };
+
+ const handleFileChange = (event) => {
+ const selectedFile = event.target.files[0];
+ setFile(selectedFile);
+ };
+
+ return (
+
+
+
+ Confirm
+
+
+
+
+ Deposit Amount
+
+
+
+ Fees
+
+ {errors.fees && (
+
+ {errors.fees.message}
+
+ )}
+
+
+ Total Amount
+
+ {errors.totalAmount && (
+
+ {errors.totalAmount.message}
+
+ )}
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default ConfirmModal;
diff --git a/src/Pages/Deposit/DepositViewHistory/DepositHistory.jsx b/src/Pages/Deposit/DepositViewHistory/DepositHistory.jsx
new file mode 100644
index 0000000..7c22add
--- /dev/null
+++ b/src/Pages/Deposit/DepositViewHistory/DepositHistory.jsx
@@ -0,0 +1,307 @@
+import {
+ Badge,
+ Box,
+ Button,
+ HStack,
+ Input,
+ Switch,
+ Text,
+ Tooltip,
+ useToast,
+ useDisclosure
+} from "@chakra-ui/react";
+import React, { useContext, useEffect, useState } from "react";
+import { HiDotsVertical } from "react-icons/hi";
+import { Link, Link as RouterLink, useNavigate } from "react-router-dom";
+import { debounce } from "../../Master/Sponser/AddSponser";
+import { OPACITY_ON_LOAD } from "../../../Layout/animations";
+import Pagination from "../../../Components/Pagination";
+import GlobalStateContext from "../../../Contexts/GlobalStateContext";
+import CustomAlertDialog from "../../../Components/CustomAlertDialog";
+import ToastBox from "../../../Components/ToastBox";
+import DataTable from "../../../Components/DataTable/DataTable";
+import ConfirmModal from "./ConfirmModal";
+import RejectModal from "./RejectModal";
+
+const formatDate = (date) => new Date(date).toLocaleDateString(); // Simple date formatter
+
+const DepositHistory = () => {
+ const navigate = useNavigate();
+ const toast = useToast();
+ const { depositHistory, setDepositHistory, slideFromRight } =
+ useContext(GlobalStateContext);
+ const [searchTerm, setSearchTerm] = useState("");
+ const [isLoading, setIsLoading] = useState(true);
+ const [deleteAlert, setDeleteAlert] = useState(false);
+ const [actionId, setActionId] = useState(false);
+ const [mouseEntered, setMouseEntered] = useState(false);
+ const [mouseEnteredId, setMouseEnteredId] = useState("");
+ const {
+ isOpen: isConfirmOpen,
+ onOpen: onConfirmOpen,
+ onClose: onConfirmClose,
+ } = useDisclosure();
+ const {
+ isOpen: isRejectOpen,
+ onOpen: onRejectOpen,
+ onClose: onRejectClose,
+ } = useDisclosure();
+
+ useEffect(() => {
+ // Simulate loading
+ const timer = setTimeout(() => {
+ setIsLoading(false);
+ }, 1500);
+
+ // Cleanup the timer on component unmount
+ return () => clearTimeout(timer);
+ }, []);
+
+ // ====================================================[Table Setup]================================================================
+ const tableHeadRow = [
+ "Sr.no",
+ "Date",
+ "Client ID",
+ "First Name",
+ "Last Name",
+ "Country",
+ "Phone Number",
+ "Currency",
+ "Deposit Amount",
+ "Fees",
+ "Total Amount",
+ "Amount in Investor currency",
+ "Status",
+ ];
+
+ const handleUpdateStatus = debounce((id) => {
+ setDepositHistory((prevDepositHistory) =>
+ prevDepositHistory.map((depositHistory) =>
+ depositHistory.id === id
+ ? { ...depositHistory, status: !depositHistory.status }
+ : depositHistory
+ )
+ );
+ toast({
+ render: () => ,
+ });
+ }, 300);
+
+ // ====================================================[Table Filter]================================================================
+ const filteredData = depositHistory.filter((item) => {
+ // Filter by name (case insensitive)
+ const name = item.clientId;
+ const searchLower = searchTerm.toLowerCase();
+ const nameMatches = name.toLowerCase().includes(searchLower);
+
+ return nameMatches;
+ });
+
+ // const handleView = (id) => {
+ // setActionId(id);
+ // onViewOpen();
+ // };
+
+ const [extractedArray, setExtractedArray] = useState(
+ filteredData?.map((item, index) => ({
+ "Sr.no": (
+
+ {index + 1}
+
+ ),
+ "Date": (
+
+ {item.date}
+
+ ),
+ "Client ID": (
+
+ {item.clientId}
+
+ ),
+ "First Name": (
+
+
+ {item.firstName}
+
+
+ ),
+ "Last Name": (
+
+
+ {item.lastName}
+
+
+ ),
+ Country: (
+
+
+ {item.country}
+
+
+ ),
+ "Phone Number": (
+
+
+ {item.phoneNumber}
+
+
+ ),
+ Currency: (
+
+
+
+ {item.currency}
+
+
+
+ ),
+ "Deposit Amount": (
+
+
+ {item.depositAmount}
+
+
+ ),
+ Fees: (
+
+
+ {item.fees}
+
+
+ ),
+ "Total Amount": (
+
+
+ {item.totalAmount}
+
+
+ ),
+ "Amount in Investor currency": (
+
+
+ {item.amountcurrency}
+
+
+ ),
+ Status: (
+
+ {
+ // setActionId(item.id);
+ // onConfirmOpen();
+ // }}
+ onClick={() => {
+ setActionId(item.id);
+ if (item.status === "Approved") {
+ onConfirmOpen();
+ } else {
+ onRejectOpen();
+ }
+ }}
+ as={"span"}
+ color={item.status === "Approved" ? "green" : "red"}
+ >
+ {item.status}
+
+
+ ),
+ }))
+ );
+
+ const handleDelete = () => {
+ const IOtype = investmentType.filter(
+ (investmentType) => investmentType.id !== actionId
+ );
+
+ setTimeout(() => {
+ setInvestmentType(IOtype);
+ setDeleteAlert(false);
+ setIsLoading(false);
+ }, 100);
+ setIsLoading(true);
+ };
+
+ return (
+
+
+
+
+
+ setSearchTerm(e.target.value)}
+ />
+
+
+
+
+
+
+
+
+
+ setDeleteAlert(false)}
+ isOpen={deleteAlert}
+ message={"Are you sure you want to delete sponers?"}
+ alertHandler={handleDelete}
+ isLoading={isLoading}
+ />
+
+ );
+};
+
+export default DepositHistory;
diff --git a/src/Pages/Deposit/DepositViewHistory/RejectModal.jsx b/src/Pages/Deposit/DepositViewHistory/RejectModal.jsx
new file mode 100644
index 0000000..66952dd
--- /dev/null
+++ b/src/Pages/Deposit/DepositViewHistory/RejectModal.jsx
@@ -0,0 +1,99 @@
+import {
+ Box,
+ Button,
+ FormControl,
+ FormLabel,
+ Input,
+ Modal,
+ ModalBody,
+ ModalCloseButton,
+ ModalContent,
+ ModalFooter,
+ ModalHeader,
+ ModalOverlay,
+ Text,
+ Textarea,
+ useDisclosure,
+} from "@chakra-ui/react";
+import React from "react";
+import * as yup from "yup";
+import { yupResolver } from "@hookform/resolvers/yup";
+import { useForm } from "react-hook-form";
+
+export const conformModalSchema = yup.object().shape({
+ comment: yup.string().required("Comment is required"),
+});
+
+const RejectModal = ({ isOpen, onClose, firstField }) => {
+ const {
+ register,
+ handleSubmit,
+ formState: { errors },
+ } = useForm({
+ resolver: yupResolver(conformModalSchema),
+ });
+
+ const onSubmit = (data) => {
+ console.log(data);
+ setFile(data.document[0]);
+
+ const newDocument = {
+ ...data,
+ document: data.document[0].name, // Store the document name
+ comment: true,
+ id: uuidv4(),
+ Type: getFileIcon(file.type),
+ };
+
+ setCreate((prevCreate) => [...prevCreate, newDocument]);
+ onClose();
+ };
+
+ const handleFileChange = (event) => {
+ const selectedFile = event.target.files[0];
+ setFile(selectedFile);
+ };
+
+ return (
+
+
+
+ Reject
+
+
+
+
+ Comment
+
+ {errors.comment && (
+
+ {errors.comment.message}
+
+ )}
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default RejectModal;
diff --git a/src/Pages/IO_Management/CreateIO/InvestmentDocument.jsx b/src/Pages/IO_Management/CreateIO/InvestmentDocument.jsx
index 24a98c1..4e329b7 100644
--- a/src/Pages/IO_Management/CreateIO/InvestmentDocument.jsx
+++ b/src/Pages/IO_Management/CreateIO/InvestmentDocument.jsx
@@ -222,7 +222,6 @@ const InvestmentDocument = ({ control, errors, enableNextTab, index }) => {
),
}));
-
return (
@@ -246,7 +245,7 @@ const InvestmentDocument = ({ control, errors, enableNextTab, index }) => {
>
Add Document
- {
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr N/O",
+ "Client ID",
"First Name",
"Last Name",
"Country",
"Phone Number",
"E-mail ID",
"KYC Status",
- "Invested Property",
"Status",
"Action",
];
@@ -120,6 +120,13 @@ const InvestorDetails = () => {
{item.id}
),
+ "Client ID": (
+
+
+ {item.clientId}
+
+
+ ),
"First Name": (
@@ -162,15 +169,6 @@ const InvestorDetails = () => {
),
- "Invested Property": (
-
-
-
- View
-
-
-
- ),
Status: (
{
>
-
-
-
-
-
-
-
-
),
}));
diff --git a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx
index da8d15b..510ed0d 100644
--- a/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx
+++ b/src/Pages/Investor_Management/InvestorDetails/ProfileView.jsx
@@ -1,4 +1,4 @@
-import { Box } from "@chakra-ui/react";
+import { Box, Tab, TabList, TabPanel, TabPanels, Tabs } from "@chakra-ui/react";
import { useNavigate, useParams } from "react-router-dom";
import { useContext, useEffect, useState } from "react";
import { useForm } from "react-hook-form"; // assuming react-hook-form is used
@@ -6,6 +6,7 @@ import { OPACITY_ON_LOAD } from "../../../Layout/animations";
import { ArrowBackIcon } from "@chakra-ui/icons";
import GlobalStateContext from "../../../Contexts/GlobalStateContext";
import FormInputView from "../../../Components/FormInputView";
+import ViewInvestorDetails from "./ViewInvestorDetails";
const ProfileView = () => {
const navigate = useNavigate();
@@ -23,13 +24,21 @@ const ProfileView = () => {
}
const formFields = [
+ {
+ label: "Client ID",
+ value: foundObject.clientId,
+ type: "text",
+ isRequired: true,
+ section: "",
+ width: "32%",
+ },
{
label: "Full Name",
value: foundObject.fullName,
type: "text",
isRequired: true,
section: "",
- width:"32%"
+ width: "32%",
},
{
label: "E-mail ID",
@@ -38,7 +47,7 @@ const ProfileView = () => {
isRequired: true,
arabic: true,
section: "",
- width:"32%"
+ width: "32%",
},
{
label: "Phone Number",
@@ -47,7 +56,7 @@ const ProfileView = () => {
isRequired: true,
arabic: true,
section: "",
- width:"32%"
+ width: "32%",
},
{
label: "Address",
@@ -55,7 +64,7 @@ const ProfileView = () => {
type: "text",
isRequired: true,
section: "",
- width:"32%"
+ width: "32%",
},
{
label: "Bank Name",
@@ -63,7 +72,7 @@ const ProfileView = () => {
type: "text",
isRequired: true,
section: "",
- width:"32%"
+ width: "32%",
},
{
label: "Branch Address",
@@ -71,7 +80,7 @@ const ProfileView = () => {
type: "text",
isRequired: true,
section: "",
- width:"32%"
+ width: "32%",
},
{
label: "IBAN",
@@ -79,7 +88,7 @@ const ProfileView = () => {
type: "text",
isRequired: true,
section: "",
- width:"32%"
+ width: "32%",
},
{
label: "SWIFT/BIC code",
@@ -87,7 +96,7 @@ const ProfileView = () => {
type: "text",
isRequired: true,
section: "",
- width:"32%"
+ width: "32%",
},
{
label: "Reference ID",
@@ -95,7 +104,7 @@ const ProfileView = () => {
type: "text",
isRequired: true,
section: "",
- width:"32%"
+ width: "32%",
},
];
@@ -116,7 +125,38 @@ const ProfileView = () => {
>
Back
-
+
+
+
+
+ View Details
+
+
+ Invested Property
+
+
+
+
+
+
+
+
+
+
+
+
);
};
diff --git a/src/Pages/Investor_Management/InvestorDetails/ViewInvestorDetails.jsx b/src/Pages/Investor_Management/InvestorDetails/ViewInvestorDetails.jsx
index ee08c6d..e8df570 100644
--- a/src/Pages/Investor_Management/InvestorDetails/ViewInvestorDetails.jsx
+++ b/src/Pages/Investor_Management/InvestorDetails/ViewInvestorDetails.jsx
@@ -61,7 +61,6 @@ const ViewInvestorDetails = () => {
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr N/O",
- "Deal ID",
"Deal Name",
"Sponsor Name",
"Investment Amount",
@@ -104,7 +103,7 @@ const ViewInvestorDetails = () => {
const extractedArray = filteredData?.map((item) => ({
id: item?.id,
"Sr N/O": (
- {
{item.id}
),
- "Deal ID": (
-
-
- {item.dealId}
-
-
- ),
"Deal Name": (
- {item.dealId}
+ {item.dealName}
),
@@ -236,17 +228,6 @@ const ViewInvestorDetails = () => {
-
-
- }
- colorScheme={"green"}
- rounded={"sm"}
- size={"sm"}
- >
- Add
-
-
@@ -258,8 +239,6 @@ const ViewInvestorDetails = () => {
isLoading={isLoading}
viewActionId={actionId}
setViewActionId={setActionId}
- // totalPages={10}
-
setMouseEnteredId={setMouseEnteredId}
setMouseEntered={setMouseEntered}
/>
@@ -271,6 +250,7 @@ const ViewInvestorDetails = () => {
alertHandler={handleDelete}
isLoading={isLoading}
/>
+
);
};
diff --git a/src/Pages/WithDrawal/DrawalView/ConfirmModal.jsx b/src/Pages/WithDrawal/DrawalView/ConfirmModal.jsx
new file mode 100644
index 0000000..92b2037
--- /dev/null
+++ b/src/Pages/WithDrawal/DrawalView/ConfirmModal.jsx
@@ -0,0 +1,95 @@
+import {
+ Box,
+ Button,
+ FormControl,
+ FormLabel,
+ Input,
+ Modal,
+ ModalBody,
+ ModalCloseButton,
+ ModalContent,
+ ModalFooter,
+ ModalHeader,
+ ModalOverlay,
+ Text,
+ useDisclosure,
+ } from "@chakra-ui/react";
+ import React from "react";
+ import * as yup from "yup";
+ import { yupResolver } from "@hookform/resolvers/yup";
+ import { useForm } from "react-hook-form";
+
+ export const conformModalSchema = yup.object().shape({
+ fees: yup.string().required("File name is required"),
+ totalAmount: yup.string().required("File name is required"),
+ });
+
+ const ConfirmModal = ({ isOpen, onClose, firstField }) => {
+ const {
+ register,
+ handleSubmit,
+ formState: { errors },
+ } = useForm({
+ resolver: yupResolver(conformModalSchema),
+ });
+
+ const onSubmit = (data) => {
+ console.log(data);
+ setFile(data.document[0]);
+
+ const newDocument = {
+ ...data,
+ document: data.document[0].name, // Store the document name
+ status: true,
+ id: uuidv4(),
+ createdAt: new Date().toISOString(),
+ Type: getFileIcon(file.type),
+ };
+
+ setCreate((prevCreate) => [...prevCreate, newDocument]);
+ onClose();
+ };
+
+ const handleFileChange = (event) => {
+ const selectedFile = event.target.files[0];
+ setFile(selectedFile);
+ };
+
+ return (
+
+
+
+ Confirm
+
+
+
+
+ Withdrawal Amount
+
+
+
+
+
+
+
+
+
+
+ );
+ };
+
+ export default ConfirmModal;
+
\ No newline at end of file
diff --git a/src/Pages/WithDrawal/DrawalView/RejectModal.jsx b/src/Pages/WithDrawal/DrawalView/RejectModal.jsx
new file mode 100644
index 0000000..4dcd030
--- /dev/null
+++ b/src/Pages/WithDrawal/DrawalView/RejectModal.jsx
@@ -0,0 +1,100 @@
+import {
+ Box,
+ Button,
+ FormControl,
+ FormLabel,
+ Input,
+ Modal,
+ ModalBody,
+ ModalCloseButton,
+ ModalContent,
+ ModalFooter,
+ ModalHeader,
+ ModalOverlay,
+ Text,
+ Textarea,
+ useDisclosure,
+ } from "@chakra-ui/react";
+ import React from "react";
+ import * as yup from "yup";
+ import { yupResolver } from "@hookform/resolvers/yup";
+ import { useForm } from "react-hook-form";
+
+ export const conformModalSchema = yup.object().shape({
+ comment: yup.string().required("Comment is required"),
+ });
+
+ const RejectModal = ({ isOpen, onClose, firstField }) => {
+ const {
+ register,
+ handleSubmit,
+ formState: { errors },
+ } = useForm({
+ resolver: yupResolver(conformModalSchema),
+ });
+
+ const onSubmit = (data) => {
+ console.log(data);
+ setFile(data.document[0]);
+
+ const newDocument = {
+ ...data,
+ document: data.document[0].name, // Store the document name
+ comment: true,
+ id: uuidv4(),
+ Type: getFileIcon(file.type),
+ };
+
+ setCreate((prevCreate) => [...prevCreate, newDocument]);
+ onClose();
+ };
+
+ const handleFileChange = (event) => {
+ const selectedFile = event.target.files[0];
+ setFile(selectedFile);
+ };
+
+ return (
+
+
+
+ Reject
+
+
+
+
+ Comment
+
+ {errors.comment && (
+
+ {errors.comment.message}
+
+ )}
+
+
+
+
+
+
+
+
+
+ );
+ };
+
+ export default RejectModal;
+
\ No newline at end of file
diff --git a/src/Pages/WithDrawal/DrawalView/ViewHistory.jsx b/src/Pages/WithDrawal/DrawalView/ViewHistory.jsx
new file mode 100644
index 0000000..7660f18
--- /dev/null
+++ b/src/Pages/WithDrawal/DrawalView/ViewHistory.jsx
@@ -0,0 +1,274 @@
+import {
+ Avatar,
+ Badge,
+ Box,
+ Button,
+ HStack,
+ Input,
+ Text,
+ Tooltip,
+ useDisclosure,
+ useToast,
+} from "@chakra-ui/react";
+import React, { useContext, useEffect, useState } from "react";
+import { OPACITY_ON_LOAD } from "../../../Layout/animations";
+import DataTable from "../../../Components/DataTable/DataTable";
+import Pagination from "../../../Components/Pagination";
+import GlobalStateContext from "../../../Contexts/GlobalStateContext";
+import CustomAlertDialog from "../../../Components/CustomAlertDialog";
+import { formatDate } from "../../../Components/Functions/UTCConvertor";
+import { CheckIcon, CloseIcon } from "@chakra-ui/icons";
+import ConfirmModal from "./ConfirmModal";
+import RejectModal from "./RejectModal";
+// import { formatDate } from "../../Components/Functions/UTCConvertor";
+
+const ViewHistory = () => {
+ const toast = useToast();
+ const { slideFromRight, viewHistory, setViewHistory } =
+ useContext(GlobalStateContext);
+ const [searchTerm, setSearchTerm] = useState("");
+ const [isLoading, setIsLoading] = useState(true);
+ const [deleteAlert, setDeleteAlert] = useState(false);
+ const [actionId, setActionId] = useState(false);
+ const [mouseEntered, setMouseEntered] = useState(false);
+ const [mouseEnteredId, setMouseEnteredId] = useState("");
+ const {
+ isOpen: isConfirmOpen,
+ onOpen: onConfirmOpen,
+ onClose: onConfirmClose,
+ } = useDisclosure();
+ const {
+ isOpen: isRejectOpen,
+ onOpen: onRejectOpen,
+ onClose: onRejectClose,
+ } = useDisclosure();
+
+ useEffect(() => {
+ // Simulate loading
+ const timer = setTimeout(() => {
+ setIsLoading(false);
+ }, 1500);
+
+ // Cleanup the timer on component unmount
+ return () => clearTimeout(timer);
+ }, []);
+
+ // ====================================================[Table Filter]================================================================
+ const filteredData = viewHistory.filter((item) => {
+ // Filter by name (case insensitive)
+ const name = item.clientId;
+ const searchLower = searchTerm.toLowerCase();
+ const nameMatches = name.toLowerCase().includes(searchLower);
+
+ // Filter by status
+ // const status = item.status;
+ // const statusLower = status ? "active" : "inactive";
+
+ // const statusMatches =
+ // statusFilter === "all" ||
+ // (statusFilter === "active" && status === true) ||
+ // (statusFilter === "inactive" && status === false);
+
+ return nameMatches;
+ });
+
+ // ====================================================[Table Setup]================================================================
+ const tableHeadRow = [
+ "Sr.no",
+ "Date",
+ "Client ID",
+ "First Name",
+ "Last Name",
+ "Country",
+ "Phone Number",
+ "Currency",
+ "Withdrawal Amount",
+ "Amount in Investor currency",
+ "Status",
+ ];
+
+ const [extractedArray, setExtractedArray] = useState(
+ filteredData?.map((item, index) => ({
+ // id: item?.id,
+ "Sr.no": (
+
+ {index + 1}
+
+ ),
+ "Date": (
+
+ {item.date}
+
+ ),
+ "Client ID": (
+
+ {item.clientId}
+
+ ),
+ "First Name": (
+
+
+ {item.firstName}
+
+
+ ),
+ "Last Name": (
+
+
+ {item.lastName}
+
+
+ ),
+ Country: (
+
+
+ {item.country}
+
+
+ ),
+ "Phone Number": (
+
+
+ {item.phoneNumber}
+
+
+ ),
+ Currency: (
+
+
+ {item.currency}
+
+
+ ),
+ "Withdrawal Amount": (
+
+
+ {item.withDrawalAmount}
+
+
+ ),
+ "Amount in Investor currency": (
+
+
+ {item.amountcurrency}
+
+
+ ),
+ Status: (
+
+ {
+ setActionId(item.id);
+ if (item.status === "Approved") {
+ onConfirmOpen();
+ } else {
+ onRejectOpen();
+ }
+ }}
+ as={"span"}
+ color={item.status === "Approved" ? "green" : "red"}
+ >
+ {item.status}
+
+
+ ),
+ }))
+ );
+
+ const handleDelete = () => {
+ const updatedSponsors = sponser.filter(
+ (sponsor) => sponsor.id !== actionId
+ );
+
+ setTimeout(() => {
+ setSponser(updatedSponsors);
+ setDeleteAlert(false);
+ setIsLoading(false);
+ }, 100);
+ setIsLoading(true);
+ };
+
+ return (
+
+
+
+
+
+ setSearchTerm(e.target.value)}
+ />
+
+
+
+
+
+
+
+
+
+ setDeleteAlert(false)}
+ isOpen={deleteAlert}
+ message={"Are you sure you want to delete sponers?"}
+ alertHandler={handleDelete}
+ isLoading={isLoading}
+ />
+
+ );
+};
+
+export default ViewHistory;
diff --git a/src/Pages/WithDrawal/PendingRequest.jsx b/src/Pages/WithDrawal/PendingRequest.jsx
index 84b52b0..1cede62 100644
--- a/src/Pages/WithDrawal/PendingRequest.jsx
+++ b/src/Pages/WithDrawal/PendingRequest.jsx
@@ -43,7 +43,7 @@ const PendingRequest = () => {
// ====================================================[Table Filter]================================================================
const filteredData = pendingRequest.filter((item) => {
// Filter by name (case insensitive)
- const name = item.Distribution;
+ const name = item.clientId;
const searchLower = searchTerm.toLowerCase();
const nameMatches = name.toLowerCase().includes(searchLower);
@@ -61,114 +61,155 @@ const PendingRequest = () => {
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
- "Sr No.",
+ "Sr.no",
"Date",
- "Distribution Amount",
- "Charges (USD)",
- "Year",
- "Quater",
+ "Client ID",
+ "First Name",
+ "Last Name",
+ "Country",
+ "Phone Number",
+ "Currency",
+ "Withdrawal Amount",
+ "Amount in Investor currency",
"Action",
];
- const extractedArray = filteredData?.map((item, index) => ({
- id: item?.id,
- "Sr No.": (
-
- {index + 1}.
-
- ),
- Date: (
-
- {formatDate(item.date)}
-
- ),
- "Distribution Amount": (
-
- {item.Distribution}
-
- ),
- "Charges (USD)": (
-
- {item.charge}
- {/* {formatDate(item.charge)} */}
-
- ),
- Year: (
-
- {item.year}
-
- ),
- Quater: (
-
- {item.quater}
-
- ),
-
- Action: (
-
- ({
+ // id: item?.id,
+ "Sr.no": (
+
-
-
-
+ ),
+ "Date": (
+
-
-
-
- ),
- }));
+ {item.date}
+
+ ),
+ "Client ID": (
+
+ {item.clientId}
+
+ ),
+ "First Name": (
+
+
+ {item.firstName}
+
+
+ ),
+ "Last Name": (
+
+
+ {item.lastName}
+
+
+ ),
+ Country: (
+
+
+ {item.country}
+
+
+ ),
+ "Phone Number": (
+
+
+ {item.phoneNumber}
+
+
+ ),
+ Currency: (
+
+
+ {item.currency}
+
+
+ ),
+ "Withdrawal Amount": (
+
+
+ {item.withDrawalAmount}
+
+
+ ),
+ "Amount in Investor currency": (
+
+
+ {item.amountcurrency}
+
+
+ ),
+ Action: (
+
+
+
+
+
+
+
+
+
+
+
+
+ ),
+ }))
+ );
const handleDelete = () => {
const updatedSponsors = sponser.filter(
diff --git a/src/Pages/WithDrawal/ViewHistory.jsx b/src/Pages/WithDrawal/ViewHistory.jsx
deleted file mode 100644
index cc2a2c9..0000000
--- a/src/Pages/WithDrawal/ViewHistory.jsx
+++ /dev/null
@@ -1,220 +0,0 @@
-import {
- Avatar,
- Badge,
- Box,
- Button,
- HStack,
- Input,
- Text,
- Tooltip,
- useToast,
-} from "@chakra-ui/react";
-import React, { useContext, useEffect, useState } from "react";
-import { OPACITY_ON_LOAD } from "../../Layout/animations";
-import DataTable from "../../Components/DataTable/DataTable";
-import Pagination from "../../Components/Pagination";
-import GlobalStateContext from "../../Contexts/GlobalStateContext";
-import CustomAlertDialog from "../../Components/CustomAlertDialog";
-import { formatDate } from "../../Components/Functions/UTCConvertor";
-import { CheckIcon, CloseIcon } from "@chakra-ui/icons";
-// import { formatDate } from "../../Components/Functions/UTCConvertor";
-
-const ViewHistory = () => {
- const toast = useToast();
- const { slideFromRight, viewHistory, setViewHistory } =
- useContext(GlobalStateContext);
- const [searchTerm, setSearchTerm] = useState("");
- const [isLoading, setIsLoading] = useState(true);
- const [deleteAlert, setDeleteAlert] = useState(false);
- const [actionId, setActionId] = useState(false);
- const [mouseEntered, setMouseEntered] = useState(false);
- const [mouseEnteredId, setMouseEnteredId] = useState("");
-
- useEffect(() => {
- // Simulate loading
- const timer = setTimeout(() => {
- setIsLoading(false);
- }, 1500);
-
- // Cleanup the timer on component unmount
- return () => clearTimeout(timer);
- }, []);
-
- // ====================================================[Table Filter]================================================================
- const filteredData = viewHistory.filter((item) => {
- // Filter by name (case insensitive)
- const name = item.Distribution;
- const searchLower = searchTerm.toLowerCase();
- const nameMatches = name.toLowerCase().includes(searchLower);
-
- // Filter by status
- // const status = item.status;
- // const statusLower = status ? "active" : "inactive";
-
- // const statusMatches =
- // statusFilter === "all" ||
- // (statusFilter === "active" && status === true) ||
- // (statusFilter === "inactive" && status === false);
-
- return nameMatches;
- });
-
- // ====================================================[Table Setup]================================================================
- const tableHeadRow = [
- "Sr No.",
- "Date",
- "Distribution Amount",
- "Charges (USD)",
- "Year",
- "Quater",
- "Action",
- ];
-
- const extractedArray = filteredData?.map((item, index) => ({
- id: item?.id,
- "Sr No.": (
-
- {index + 1}.
-
- ),
- "Date": (
-
- {formatDate(item.date)}
-
- ),
- "Distribution Amount": (
-
- {item.Distribution}
-
- ),
- "Charges (USD)": (
-
- {item.charge}
- {/* {formatDate(item.charge)} */}
-
- ),
- Year: (
-
- {item.year}
-
- ),
- Quater: (
-
- {item.quarter}
-
- ),
- Action: (
-
-
-
-
-
-
- ),
- }));
-
- const handleDelete = () => {
- const updatedSponsors = sponser.filter(
- (sponsor) => sponsor.id !== actionId
- );
-
- setTimeout(() => {
- setSponser(updatedSponsors);
- setDeleteAlert(false);
- setIsLoading(false);
- }, 100);
- setIsLoading(true);
- };
-
- return (
-
-
-
- setSearchTerm(e.target.value)}
- />
-
-
-
-
-
-
-
-
-
- setDeleteAlert(false)}
- isOpen={deleteAlert}
- message={"Are you sure you want to delete sponers?"}
- alertHandler={handleDelete}
- isLoading={isLoading}
- />
-
- );
-};
-
-export default ViewHistory;
diff --git a/src/Routes/Routes.js b/src/Routes/Routes.js
index 92e6d4c..f484f88 100644
--- a/src/Routes/Routes.js
+++ b/src/Routes/Routes.js
@@ -31,9 +31,9 @@ import EditSponser from "../Pages/Master/Sponser/EditSponser";
import Sponser from "../Pages/Master/Sponser/Sponsers";
import ViewSponser from "../Pages/Master/Sponser/ViewSponser";
import PendingRequest from "../Pages/WithDrawal/PendingRequest";
-import ViewHistory from "../Pages/WithDrawal/ViewHistory";
+import ViewHistory from "../Pages/WithDrawal/DrawalView/ViewHistory";
import DepositRequest from "../Pages/Deposit/DepositRequest";
-import DepositHistory from "../Pages/Deposit/DepositHistory";
+import DepositHistory from "../Pages/Deposit/DepositViewHistory/DepositHistory";
export const RouteLink = [
// =============[ Tanami ]================
@@ -61,7 +61,7 @@ export const RouteLink = [
// ===============[ Investor Management]===============
{ path: "/investor-details", Component: InvestorDetails },
- { path: "/profile-view/:id", Component: ProfileView },
+ { path: "/investor-details/profile-view/:id", Component: ProfileView },
{ path: "/investor-details/view-investor-details", Component: ViewInvestorDetails },
{ path: "/investor-transactions", Component: InvestorTransactions },