final update

This commit is contained in:
2024-08-16 18:23:55 +05:30
parent 1f97c841f7
commit a0b722bd12
7 changed files with 39 additions and 16 deletions

View File

@@ -151,7 +151,7 @@ const CreateIO = () => {
}, []);
const tableHeadRow = [
"Sponsorer name",
"Sponsor name",
"Address",
"Mobile no",
"Created At",
@@ -191,7 +191,7 @@ const CreateIO = () => {
const extractedArray = filteredData?.map((item) => ({
id: item?.id,
"Sponsorer name": (
"Sponsor name": (
<Text
justifyContent={"left"}
as={"span"}
@@ -413,7 +413,7 @@ const CreateIO = () => {
],
},
{
label: "Sponsorer Name (English)",
label: "Sponsor Name (English)",
placeHolder: " ",
name: "sponserName",
type: "text",

View File

@@ -209,7 +209,7 @@ const IODetails = ({ enableNextTab, index, data }) => {
investmentNameArabic: IObyID?.data?.investmentNameArabic,
descriptionEnglish: IObyID?.data?.descriptionEnglish,
descriptionArabic: IObyID?.data?.descriptionArabic,
goalAmount: removeTrailingZeros(IObyID?.data?.goalAmount),
goalAmount: IObyID?.data?.goalAmount,
closingDate: formatDatee(IObyID?.data?.closingDate),
holdingPeriod: IObyID?.data?.holdingPeriod,
ISIN: IObyID?.data?.ISIN,
@@ -341,7 +341,7 @@ const IODetails = ({ enableNextTab, index, data }) => {
value: IObyID?.data?.investmentType_xid,
},
{
label: "Sponsorer Name",
label: "Sponsor Name",
placeHolder: "Select option",
name: "sponserName",
type: "select",
@@ -354,7 +354,7 @@ const IODetails = ({ enableNextTab, index, data }) => {
{
label: "Goal Amount",
placeHolder: "$00.00",
value: removeTrailingZeros(IObyID?.data?.goalAmount),
value: IObyID?.data?.goalAmount,
name: "goalAmount",
type: "number",
isRequired: true,

View File

@@ -4,6 +4,7 @@ import {
Box,
Button,
HStack,
Icon,
Input,
Menu,
MenuButton,
@@ -26,22 +27,34 @@ import React, { useContext, useEffect, useState } from "react";
import { OPACITY_ON_LOAD } from "../../../Layout/animations";
import NormalTable from "../../../Components/DataTable/NormalTable";
import { HiDotsVertical } from "react-icons/hi";
import { Link, Link as RouterLink } from "react-router-dom";
import { Link, Link as RouterLink, useParams } from "react-router-dom";
import Pagination from "../../../Components/Pagination";
import GlobalStateContext from "../../../Contexts/GlobalStateContext";
import CustomAlertDialog from "../../../Components/CustomAlertDialog";
import ToastBox from "../../../Components/ToastBox";
import { debounce } from "../../Master/Sponser/AddSponser";
import { formatCurrency } from "../../../Components/CurrencyInput";
import { FiRefreshCw } from "react-icons/fi";
import { useGetIOByIdQuery } from "../../../Services/io.service";
const formatDate = (date) => new Date(date).toLocaleDateString(); // Simple date formatter
const Investors = ({data}) => {
const params = useParams()
const id = params?.id
const toast = useToast();
const { investors, setInvestors, slideFromRight, IODetails } =
useContext(GlobalStateContext);
console.log(IODetails?.investors);
console.log(params?.id);
const {
data: IObyID,
isLoading: IObyIDisLoading,
error: IObyIDerror,
refetch
} = useGetIOByIdQuery(id, { skip: !id });
@@ -159,7 +172,8 @@ const Investors = ({data}) => {
fontWeight={"500"}
className="d-flex align-items-center web-text-small"
>
{`$${item.InvestedAmount_USD}`}
{/* {`$${formatCurrency(item.InvestedAmount_USD)}`} */}
{`$${parseFloat(item.InvestedAmount_USD).toLocaleString()}`}
</Text>
),
"Percentage": (
@@ -181,7 +195,7 @@ const Investors = ({data}) => {
fontWeight={"500"}
className="d-flex align-items-center web-text-small"
>
{`$${item.Market_Value || 0}`}
{`$${parseFloat(item.Market_Value ||0).toLocaleString()}`}
</Text>
),
"Return on Investment": (
@@ -204,7 +218,8 @@ const Investors = ({data}) => {
fontWeight={"500"}
className="d-flex align-items-center web-text-small"
>
{`$${item.Distribution_Amt}`}
{/* {`$${item.Distribution_Amt}`} */}
{`$${parseFloat(item.Distribution_Amt||0).toLocaleString()}`}
</Text>
),
"Total Return": (
@@ -215,7 +230,8 @@ const Investors = ({data}) => {
fontWeight={"500"}
className="d-flex align-items-center web-text-small"
>
{`$${item.Total_Return || 0}`}
{/* {`$${formatCurrency(item.Total_Return) || 0}`} */}
{`$${parseFloat(item.Total_Return||0).toLocaleString()}`}
</Text>
),
"Total return on Investment": (
@@ -365,12 +381,17 @@ const Investors = ({data}) => {
);
};
const handleRefresh = () =>{
refetch()
}
return (
<Box {...OPACITY_ON_LOAD} pb={0}>
<Box bg="white.500">
<HStack
display={"flex"}
justifyContent={"space-between"}
justifyContent={"start"}
pb={3}
spacing="24px"
>
@@ -388,6 +409,7 @@ const Investors = ({data}) => {
{/* <HStack display={"flex"} alignItems={"center"}>
<Pagination totalItems={10} />
</HStack> */}
<Icon onClick={handleRefresh} fontWeight={600} as={FiRefreshCw} boxSize={8} p={2} rounded={'md'} _hover={{bg:'gray.100'}} cursor={'pointer'} />
</HStack>
</Box>

View File

@@ -70,6 +70,7 @@ const UpdateIOStatus = ({ isOpen, onClose, status }) => {
setSelectedItem(null)
setSelectedStatusId(null)
onClose()
setError("")
}
return (

View File

@@ -82,7 +82,7 @@ const ViewIOTable = () => {
const tableHeadRow = [
"IO ID",
"IO Name",
"Sponsorer",
"Sponsor",
"Investment Type",
"Goal Amount",
"Holding Period",

View File

@@ -241,7 +241,7 @@ const filteredMenu = menu?.filter(item => apiTransactionTitles?.includes(item.id
<Box display={"flex"} flexDirection={"column"} gap={2}>
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
Sponsorer Name
Sponsor Name
</Text>
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
{IODetails?.sponsor?.sponsorName

View File

@@ -249,7 +249,7 @@ const ViewIOdetails = () => {
width: "32.3%",
},
{
label: "Sponsorer Name",
label: "Sponsor Name",
placeHolder: "Select option",
name: "sponsor_xid",
type: "select",