2024-06-26 12:03:13 +05:30
|
|
|
import {
|
|
|
|
|
Box,
|
|
|
|
|
Image,
|
|
|
|
|
Skeleton,
|
|
|
|
|
Tab,
|
|
|
|
|
TabIndicator,
|
|
|
|
|
TabList,
|
|
|
|
|
TabPanel,
|
|
|
|
|
TabPanels,
|
|
|
|
|
Tabs,
|
|
|
|
|
Text,
|
|
|
|
|
} from "@chakra-ui/react";
|
2024-06-25 12:05:39 +05:30
|
|
|
// import error from "../assets/Error.svg"
|
2024-06-26 12:03:13 +05:30
|
|
|
// import robot from "../../../assets/robot.png"
|
|
|
|
|
import { useContext, useEffect, useState } from "react";
|
|
|
|
|
import { OPACITY_ON_LOAD } from "../../Layout/animations";
|
|
|
|
|
import InvestmentCard from "../../Components/InvestmentCard/InvestmentCard";
|
|
|
|
|
import GlobalStateContext from "../../Contexts/GlobalStateContext";
|
2024-06-25 12:05:39 +05:30
|
|
|
// import robot from "../assets/robot.png"
|
2024-06-26 12:03:13 +05:30
|
|
|
const ExchangeRate = () => {
|
|
|
|
|
const { investment, setInvestment } = useContext(GlobalStateContext);
|
|
|
|
|
const [isLoading, setIsLoading] = useState(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// Simulate loading
|
|
|
|
|
const timer = setTimeout(() => {
|
|
|
|
|
setIsLoading(false);
|
|
|
|
|
}, 1500);
|
|
|
|
|
|
|
|
|
|
// Cleanup the timer on component unmount
|
|
|
|
|
return () => clearTimeout(timer);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-25 12:05:39 +05:30
|
|
|
return (
|
2024-06-26 12:03:13 +05:30
|
|
|
<Box {...OPACITY_ON_LOAD} overflowY={"scroll"} height={"100vh"}>
|
|
|
|
|
<Tabs position="relative" variant="unstyled" mt={2}>
|
|
|
|
|
<TabList>
|
|
|
|
|
<Tab fontSize={"sm"}>All</Tab>
|
|
|
|
|
<Tab fontSize={"sm"}>Available</Tab>
|
|
|
|
|
<Tab fontSize={"sm"}>Upcomming</Tab>
|
|
|
|
|
<Tab fontSize={"sm"}>Closed</Tab>
|
|
|
|
|
</TabList>
|
|
|
|
|
<TabIndicator
|
|
|
|
|
mt="-1.5px"
|
|
|
|
|
height="2px"
|
|
|
|
|
bg="green.500"
|
|
|
|
|
borderRadius="1px"
|
|
|
|
|
/>
|
|
|
|
|
<TabPanels>
|
|
|
|
|
<TabPanel>
|
|
|
|
|
{investment?.map((investmentDetails, index) => (
|
2024-06-26 15:11:54 +05:30
|
|
|
<Skeleton key={index} isLoaded={!isLoading}><InvestmentCard investment={investmentDetails} /></Skeleton>
|
2024-06-26 12:03:13 +05:30
|
|
|
))}
|
|
|
|
|
</TabPanel>
|
|
|
|
|
<TabPanel>
|
|
|
|
|
<p>two!</p>
|
|
|
|
|
</TabPanel>
|
|
|
|
|
<TabPanel>
|
|
|
|
|
<p>three!</p>
|
|
|
|
|
</TabPanel>
|
|
|
|
|
<TabPanel>
|
|
|
|
|
<p>three!</p>
|
|
|
|
|
</TabPanel>
|
|
|
|
|
</TabPanels>
|
|
|
|
|
</Tabs>
|
2024-06-25 12:05:39 +05:30
|
|
|
</Box>
|
2024-06-26 12:03:13 +05:30
|
|
|
);
|
|
|
|
|
};
|
2024-06-25 12:05:39 +05:30
|
|
|
|
2024-06-26 12:03:13 +05:30
|
|
|
export default ExchangeRate;
|