// GlobalStateContext.js
import React, { useState } from "react";
import GlobalStateContext from "./GlobalStateContext";
import { effect, useColorMode } from "@chakra-ui/react";
import { v4 as uuidv4 } from "uuid";
import { TbClock2 } from "react-icons/tb";
import { CiWallet } from "react-icons/ci";
import { HiOutlineReceiptPercent } from "react-icons/hi2";
import { IoMdQrScanner } from "react-icons/io";
import { GrDocumentPdf } from "react-icons/gr";
import { AiOutlineFileGif } from "react-icons/ai";

const getRandomDate = (start, end) => {
  const date = new Date(
    start.getTime() + Math.random() * (end.getTime() - start.getTime())
  );
  return date.toISOString();
};

const startDate = new Date(2020, 0, 1); // January 1, 2020
const endDate = new Date(); // Current date

export const generateUniqueId = () => {
  const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  const digits = "0123456789";

  let id = "";

  // Generate three random uppercase letters
  for (let i = 0; i < 3; i++) {
    id += letters[Math.floor(Math.random() * letters.length)];
  }

  // Generate seven random digits
  for (let i = 0; i < 7; i++) {
    id += digits[Math.floor(Math.random() * digits.length)];
  }

  return id;
};

const GlobalStateProvider = ({ children }) => {
  const [isAuthenticate, setIsAuthenticate] = useState(false);
  const [memberIfo, setMemberInfo] = useState();
  const [communityMembers, setCommityMembers] = useState();
  const [slideFromRight, setSlideFormRight] = useState(false);
  const { colorMode, toggleColorMode } = useColorMode();
  const [sponser, setSponser] = useState([]);

  const [investors, setInvestors] = useState([
    {
      id: 1,
      clientId: "BH00000001",
      firstName: "Faisal",
      lastName: "Aljalahma",
      investedAmount: 100000,
      percentage: "10.0%",
      marketValue: 114050,
      returnOnInvestment: "14.1%",
      distribution: 5000,
      totalReturn: 62025,
      totalReturnOnInvestment: "24.1%",
    },
    {
      id: 2,
      clientId: "BH00000002",
      firstName: "Sara",
      lastName: "Ahmed",
      investedAmount: 150000,
      percentage: "15.0%",
      marketValue: 171075,
      returnOnInvestment: "14.05%",
      distribution: 7500,
      totalReturn: 93038,
      totalReturnOnInvestment: "25.5%",
    },
    {
      id: 3,
      clientId: "BH00000003",
      firstName: "Ali",
      lastName: "Khan",
      investedAmount: 200000,
      percentage: "20.0%",
      marketValue: 228100,
      returnOnInvestment: "14.05%",
      distribution: 10000,
      totalReturn: 124050,
      totalReturnOnInvestment: "31.0%",
    },
    {
      id: 4,
      clientId: "BH00000004",
      firstName: "Laila",
      lastName: "Hassan",
      investedAmount: 250000,
      percentage: "25.0%",
      marketValue: 285125,
      returnOnInvestment: "14.05%",
      distribution: 12500,
      totalReturn: 155063,
      totalReturnOnInvestment: "37.0%",
    },
    {
      id: 5,
      clientId: "BH00000005",
      firstName: "Omar",
      lastName: "Rahman",
      investedAmount: 300000,
      percentage: "30.0%",
      marketValue: 342150,
      returnOnInvestment: "14.05%",
      distribution: 15000,
      totalReturn: 186075,
      totalReturnOnInvestment: "43.0%",
    },
    {
      id: 6,
      clientId: "BH00000006",
      firstName: "Aisha",
      lastName: "Saeed",
      investedAmount: 350000,
      percentage: "35.0%",
      marketValue: 399175,
      returnOnInvestment: "14.05%",
      distribution: 17500,
      totalReturn: 217088,
      totalReturnOnInvestment: "49.0%",
    },
    {
      id: 7,
      clientId: "BH00000007",
      firstName: "Mohammed",
      lastName: "Yousef",
      investedAmount: 400000,
      percentage: "40.0%",
      marketValue: 456200,
      returnOnInvestment: "14.05%",
      distribution: 20000,
      totalReturn: 248100,
      totalReturnOnInvestment: "55.0%",
    },
    {
      id: 8,
      clientId: "BH00000008",
      firstName: "Fatima",
      lastName: "Jaber",
      investedAmount: 450000,
      percentage: "45.0%",
      marketValue: 513225,
      returnOnInvestment: "14.05%",
      distribution: 22500,
      totalReturn: 279113,
      totalReturnOnInvestment: "61.0%",
    },
    {
      id: 9,
      clientId: "BH00000009",
      firstName: "Yasin",
      lastName: "Abdullah",
      investedAmount: 500000,
      percentage: "50.0%",
      marketValue: 570250,
      returnOnInvestment: "14.05%",
      distribution: 25000,
      totalReturn: 310125,
      totalReturnOnInvestment: "67.0%",
    },
    {
      id: 10,
      clientId: "BH00000010",
      firstName: "Zara",
      lastName: "Mustafa",
      investedAmount: 550000,
      percentage: "55.0%",
      marketValue: 627275,
      returnOnInvestment: "14.05%",
      distribution: 27500,
      totalReturn: 341138,
      totalReturnOnInvestment: "73.0%",
    },
  ]);

  const [caseDetails, setCaseDetails] = useState([
    {
      id: 1,
      date: "02-Jan-24",
      particulars: "Cash Reserve- Initated",
      amount: "50,000.00",
      comments: " ",
      updateBy: "Faisal",
      updateOn: "02-Jan-24",
    },
    {
      id: 2,
      date: "12-Feb-24",
      particulars: "Fees & Expense",
      amount: "22,000.00",
      comments: "Fees = $20,000 Expense = $2,000 ",
      updateBy: "Faisal",
      updateOn: "13-Feb-24",
    },
    {
      id: 3,
      date: "23-Mar-24",
      particulars: "Distribution Received From Sponsor",
      amount: "50,000.00",
      comments: " ",
      updateBy: "Nawab",
      updateOn: "24-Mar-24",
    },
    {
      id: 4,
      date: "28-Mar-24",
      particulars: "Distribution Paid To Investors",
      amount: "40,000.00",
      comments: " ",
      updateBy: "Faisal",
      updateOn: "28-Mar-24",
    },
    {
      id: 5,
      date: "26-Jun-24",
      particulars: "Distribution Received From Sponsor",
      amount: "70,000.00",
      comments: " ",
      updateBy: "Faisal",
      updateOn: "27-Jun-24",
    },
    {
      id: 6,
      date: "02-Jan-24",
      particulars: "Distribution Paid To Investors",
      amount: "60,000.00",
      comments: " ",
      updateBy: "Nawab",
      updateOn: "28-Jun-24",
    },
  ]);

  const [navDetails, setNavDetails] = useState([
    {
      id: 1,
      date: "02-Jan-24",
      IONavValue: 1229750,
      comments: "MV Increased by 10%",
      updateBy: "Faisal",
      updateOn: "02-Jan-24",
    },
    {
      id: 2,
      date: "02-Jan-24",
      IONavValue: 1229750,
      comments: "MV Increased by 10%",
      updateBy: "Faisal",
      updateOn: "13-Feb-24",
    },
  ]);

  const [create, setCreate] = useState([
    {
      id: 1,
      Type: <GrDocumentPdf />,
      fileName: "Investment Private Company",
      document: "Investment.pdf",
      status: true,
    },
    {
      id: 2,
      Type: <AiOutlineFileGif fontSize={25} />,
      fileName: "Investment Private",
      document: "Investment.pdf",
      status: true,
    },
  ]);
  const [keyMerits, setKeyMerits] = useState([
    {
      id: 1,
      title: "Diversified Holdings",
      subTitle:
        "Private equity portfolio of over 60 companies in various sectors and different countries around the world",
      Icon: <TbClock2 fontSize={"18px"} />,
      status: true,
    },
    {
      id: 2,
      title: "Top-Tier Manager",
      subTitle:
        "KKR is a world-class global PE manager with over $570bn in assets under management",
      Icon: <CiWallet fontSize={"18px"} />,
      status: true,
    },
    {
      id: 3,
      title: "Strong performance",
      subTitle:
        "Direct exposure to the KKR’s best performing Buyout and Growth funds",
      Icon: <HiOutlineReceiptPercent fontSize={"18px"} />,
      status: true,
    },
    {
      id: 4,
      title: "Leading Track Record",
      subTitle:
        "Almost 50 year track record since 1977 of consistent, double-digit annual returns",
      Icon: <IoMdQrScanner fontSize={"18px"} />,
      status: true,
    },
  ]);
  const [iOArtifacts, setIOArtifacts] = useState([
    {
      id: 1,
      fileName: "Banner image",
      document: "Banner.jpg",
      status: true,
    },
    {
      id: 2,
      fileName: "Banner image",
      document: "Banner.jpg",
      status: true,
    },
    {
      id: 3,
      fileName: "Banner image",
      document: "Banner.jpg",
      status: true,
    },
    {
      id: 4,
      fileName: "Banner image",
      document: "Banner.jpg",
      status: true,
    },
  ]);

  const [iOArtifactsTwo, setIOArtifactsTwo] = useState([
    {
      id: 1,
      videoFileName: "Property preview",
      status: true,
    },
    {
      id: 2,
      videoFileName: "Property preview",
      status: true,
    },
    {
      id: 3,
      videoFileName: "Property preview",
      status: true,
    },
    {
      id: 4,
      videoFileName: "Property preview",
      status: true,
    },
  ]);

  const [investmentType, setInvestmentType] = useState([
    {
      id: 1,
      investmentName: "Commercial",
      description: "Investment Private Company",
      investmentNameArabic: "لعفكعلفكع كعلجلجعيجكجلدسجوي",
      descriptionArabic: "لعفكعلفكع كعلجلجع",
      status: true,
    },
  ]);
  const [investment, setInvestment] = useState([
    // {
    //   banner_image:
    //     "https://images.unsplash.com/photo-1667489022797-ab608913feeb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw5fHx8ZW58MHx8fHw%3D&auto=format&fit=crop&w=800&q=60",
    //   ioName: "Multi Family Residence Portfolio",
    //   sponserName: "KKR",
    //   annualReturn: "12.5%",
    //   annualyield: "12.5%",
    //   minInvests: ",00 $0",
    //   targetClose: "24 December",
    //   year: "5-7 years",
    //   tenure: 92,
    //   quaterly: "Q2",
    //   destributedAmount: 62,
    //   ioName: "Sybil Christensen",
    //   ioNameArabic: "September Kelley",
    //   status: "Available"
    // },
    // {
    //   banner_image:
    //     "https://images.unsplash.com/photo-1667489022797-ab608913feeb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw5fHx8ZW58MHx8fHw%3D&auto=format&fit=crop&w=800&q=60",
    //   ioName: "Multi Family Residence Portfolio",
    //   sponserName: "KKR",
    //   annualReturn: "12.5%",
    //   annualyield: "12.5%",
    //   minInvests: ",00 $0",
    //   targetClose: "24 December",
    //   year: "5-7 years",
    //   tenure: 92,
    //   quaterly: "Q2",
    //   destributedAmount: 62,
    //   ioName: "Sybil Christensen",
    //   ioNameArabic: "September Kelley",
    //   status: "Available"
    // },
    // {
    //   banner_image:
    //     "https://images.unsplash.com/photo-1667489022797-ab608913feeb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw5fHx8ZW58MHx8fHw%3D&auto=format&fit=crop&w=800&q=60",
    //   ioName: "Multi Family Residence Portfolio",
    //   sponserName: "KKR",
    //   annualReturn: "12.5%",
    //   annualyield: "12.5%",
    //   minInvests: ",00 $0",
    //   targetClose: "24 December",
    //   year: "5-7 years",
    //   tenure: 92,
    //   quaterly: "Q2",
    //   destributedAmount: 62,
    //   ioName: "Sybil Christensen",
    //   ioNameArabic: "September Kelley",
    //   status: "Available"
    // },
  ]);
  const [rateExchange, setRateExchange] = useState([
    {
      id: uuidv4(),
      fromCurr: "USD $",
      toCurr: "BHD .د.ب;",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
    {
      id: uuidv4(),
      fromCurr: "USD $",
      toCurr: "KWD ·د.ك",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
    {
      id: uuidv4(),
      fromCurr: "USD $",
      toCurr: "OMR ﷼.",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
    {
      id: uuidv4(),
      fromCurr: "USD $",
      toCurr: "QAR ﷼.",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
    {
      id: uuidv4(),
      fromCurr: "USD $",
      toCurr: "SAR ﷼.",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
    {
      id: uuidv4(),
      fromCurr: "USD $",
      toCurr: "AED د.إ. ",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },

    {
      id: uuidv4(),
      fromCurr: "AED د.إ. ",
      toCurr: "USD $",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
    {
      id: uuidv4(),
      fromCurr: "SAR ﷼.",
      toCurr: "USD $",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
    {
      id: uuidv4(),
      fromCurr: "QAR ﷼.",
      toCurr: "USD $",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },

    {
      id: uuidv4(),
      fromCurr: "BHD .د.ب;",
      toCurr: "USD $",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
    {
      id: uuidv4(),
      fromCurr: "KWD ·د.ك",
      toCurr: "USD $",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
    {
      id: uuidv4(),
      fromCurr: "OMR ﷼.",
      toCurr: "USD $",
      effectFrom: getRandomDate(startDate, endDate),
      effectTill: getRandomDate(startDate, endDate),
      rate: 2.66,
    },
  ]);
  const [InvestorDetails, setInvestorDetails] = useState([
    {
      id: 1,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Retail",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Completed",
      status: "Unban",
    },
    {
      id: 2,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Accredited Investors",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Incompleted",
      status: "Unban",
    },
    {
      id: 3,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Retail",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Completed",
      status: "Unban",
    },
    {
      id: 4,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Accredited Investors",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Incompleted",
      status: "Unban",
    },
    {
      id: 5,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Retail",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Completed",
      status: "Unban",
    },
    {
      id: 6,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Accredited Investors",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Completed",
      status: "Unban",
    },
    {
      id: 7,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Retail",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Incompleted",
      status: "Unban",
    },
    {
      id: 8,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Accredited Investors",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Incompleted",
      status: "Unban",
    },
    {
      id: 9,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Retail",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Completed",
      status: "Unban",
    },
    {
      id: 10,
      clientId: "SA00000001",
      fullName: "John David",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      address: "Saudi Arabia",
      emailID: "john@gmail.com",
      InvestorType: "Accredited Investors",
      bankName: "Lorem Text",
      branchAddress: "Hohenzollernring 58, 95444",
      iban: "DE 1234 5678 9012 3456",
      swiftCode: "BC12345",
      referenceID: "FRYU FHDU 1234",
      kycStatus: "Completed",
      status: "Unban",
    },
  ]);

  const [viewInvestor, setViewInvestor] = useState([]);
  const [transaction, setTransaction] = useState([]);

  const [investorTransaction, setInvestorTransaction] = useState([
    {
      id: 1,
      InvestorName: "ICC",
      Sponsor: "Adani",
      InvestmentAmount: "1000000",
      Action: "Distribute",
    },
    {
      id: 2,
      InvestorName: "ECHO Investment",
      Sponsor: "Tata",
      InvestmentAmount: "2500000",
      Action: "Distribute",
    },
    {
      id: 3,
      InvestorName: "ICC",
      Sponsor: "Adani",
      InvestmentAmount: "1000000",
      Action: "Distribute",
    },
    {
      id: 4,
      InvestorName: "ECHO Investment",
      Sponsor: "Tata",
      InvestmentAmount: "2500000",
      Action: "Distribute",
    },
  ]);

  const [pendingRequest, setPendingRequest] = useState([
    {
      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: 2,
      date: "02-Jan-2024",
      clientId: "KU00000001",
      firstName: "Faisal",
      lastName: "Aljalahma",
      country: "Kuwait",
      phoneNumber: "8226278945",
      currency: "KWD",
      withDrawalAmount: "$200,000",
      amountcurrency: "62438.98",
    },
    {
      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: 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: 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: 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: 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: 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([
    {
      id: uuidv4(),
      date: "2024-01-15",
      Distribution: "Office supplies",
      charge: "200.50",
      year: "2024",
      quarter: "Q1",
      amount: 1500,
    },
    {
      id: uuidv4(),
      date: "2024-02-10",
      Distribution: "Marketing expenses",
      charge: "450.00",
      year: "2024",
      quarter: "Q1",
      amount: 2000,
    },
    {
      id: uuidv4(),
      date: "2024-03-05",
      Distribution: "Software subscription",
      charge: "300.75",
      year: "2024",
      quarter: "Q1",
      amount: 1200,
    },
    {
      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,
    },
  ]);
  const [deleteHistory, setDeleteHistory] = useState([
    {
      id: 1,
      firstName: "satyam",
      lastName: "Bendal",
      clientId: "QA00000003", 
      RequestedOn: "2024-08-21T08:12:08.000Z",
      phoneNumber: "6387524874",
      country: "Qatar",
      status: "Approved",
    },
  ]);
  const [investorRequest, setInvestorRequest] = useState([
    {
      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: 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,
    },
  ]);
  const [deleteRequest, setDeleteRequest] = useState([
    {
        "id": 2,
        "firstName": "satyam",
        "lastName": "Bendal",
        "clientId": "QA00000003",
        "RequestedOn": "2024-08-21T09:44:21.000Z",
        "phoneNumber": "6387524874",
        "country": "Qatar",
        "status": "Pending"
    },
    {
        "id": 3,
        "firstName": "satyam",
        "lastName": "Bendal",
        "clientId": "QA00000003",
        "RequestedOn": "2024-08-21T09:53:03.000Z",
        "phoneNumber": "6387524874",
        "country": "Qatar",
        "status": "Pending"
    }
]);
  const [viewIO, setViewIO] = useState([
    {
      id: 1,
      DealID: "UWE3424992",
      DealName: "K-Prime",
      SponsorName: "KKR",
      IOstatus: "Open",
    },
    {
      id: 2,
      DealID: "UWE3424993",
      DealName: "K-Prime",
      SponsorName: "KKR",
      IOstatus: "Pending",
    },
    {
      id: 3,
      DealID: "UWE3424994",
      DealName: "K-Prime",
      SponsorName: "KKR",
      IOstatus: "Close",
    },
    {
      id: 4,
      DealID: "UWE3424995",
      DealName: "K-Prime",
      SponsorName: "KKR",
      IOstatus: "Open",
    },
  ]);

  const [depositRequest, setDepositRequest] = useState([
    {
      id: 1,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      currency: "SAR",
      depositAmount: "$100,000",
      fees: "$2,000",
      totalAmount: "$102,000",
      amountcurrency: "382574.17",
    },
    {
      id: 2,
      date: "02-Jan-2024",
      clientId: "KU00000001",
      firstName: "Faisal",
      lastName: "Aljalahma",
      country: "Kuwait",
      phoneNumber: "8226278945",
      currency: "KWD",
      depositAmount: "$200,000",
      fees: "$4,000",
      totalAmount: "$204,000",
      amountcurrency: "62438.98",
    },
    {
      id: 3,
      date: "02-Jan-2024",
      clientId: "BH00000001",
      firstName: "Nawaf",
      lastName: "Almaskati",
      country: "Bahrain",
      phoneNumber: "8940035906",
      currency: "BHD",
      depositAmount: "$300,000",
      fees: "$6,000",
      totalAmount: "$306,000",
      amountcurrency: "115328.04",
    },
    {
      id: 4,
      date: "02-Jan-2024",
      clientId: "SA00000002",
      firstName: "Sulaiman",
      lastName: "AlBassam",
      country: "Saudi Arabia",
      phoneNumber: "8226278945",
      currency: "SAR",
      depositAmount: "$400,000",
      fees: "$8,000",
      totalAmount: "$408,000",
      amountcurrency: "1530296.67",
    },
  ]);

  const [depositHistory, setDepositHistory] = useState([
    {
      id: 1,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      currency: "SAR",
      depositAmount: "$100,000",
      fees: "$2,000",
      totalAmount: "$102,000",
      amountcurrency: "382574.17",
      status: "Approved",
    },
    {
      id: 2,
      date: "02-Jan-2024",
      clientId: "KU00000001",
      firstName: "Faisal",
      lastName: "Aljalahma",
      country: "Kuwait",
      phoneNumber: "8226278945",
      currency: "KWD",
      depositAmount: "$200,000",
      fees: "$4,000",
      totalAmount: "$204,000",
      amountcurrency: "62438.98",
      status: "Rejected",
    },
    {
      id: 3,
      date: "02-Jan-2024",
      clientId: "BH00000001",
      firstName: "Nawaf",
      lastName: "Almaskati",
      country: "Bahrain",
      phoneNumber: "8940035906",
      currency: "BHD",
      depositAmount: "$300,000",
      fees: "$6,000",
      totalAmount: "$306,000",
      amountcurrency: "115328.04",
      status: "Approved",
    },
    {
      id: 4,
      date: "02-Jan-2024",
      clientId: "SA00000002",
      firstName: "Sulaiman",
      lastName: "AlBassam",
      country: "Saudi Arabia",
      phoneNumber: "8226278945",
      currency: "SAR",
      depositAmount: "$400,000",
      fees: "$8,000",
      totalAmount: "$408,000",
      amountcurrency: "1530296.67",
      status: "Rejected",
    },
  ]);

  const [bankInvestor, setBankInvestor] = useState([
    {
      id: 1,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Completed",
    },
    {
      id: 2,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Incompleted",
    },
    {
      id: 3,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Completed",
    },
    {
      id: 4,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Incompleted",
    },
    {
      id: 5,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Completed",
    },
    {
      id: 6,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Incompleted",
    },
    {
      id: 7,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Incompleted",
    },
    {
      id: 8,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Completed",
    },
    {
      id: 9,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Completed",
    },
    {
      id: 10,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Incompleted",
    },
    {
      id: 10,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Incompleted",
    },
    {
      id: 10,
      date: "02-Jan-2024",
      clientId: "SA00000001",
      firstName: "John",
      lastName: "David",
      country: "Saudi Arabia",
      phoneNumber: "8940035906",
      mailId: "john@gmail.com",
      status: "Incompleted",
    },
  ]);

  const [manageAcademy, setManageAcademy] = useState([
    {
      id: 1,
      header: "Investing in Private Equity",
      content: "Private equity investing involve...",
      bannerImage: "John",
    },
    {
      id: 2,
      header: "Investing in Private Equity",
      content: "Private equity investing involve...",
      bannerImage: "John",
    },
    {
      id: 3,
      header: "Investing in Private Equity",
      content: "Private equity investing involve...",
      bannerImage: "John",
    },
  ]);

  const [manageVideo, setManageVideo] = useState([
    {
      id: 1,
      name: "Investing in Private Equity",
      videoUploaded: "Video.mp4",
    },
  ]);

  const [academicDocuments, setAcademicDocuments] = useState([
    {
      id: 1,
      fullName: "Investing in Private Equity",
      document: "Video.mp4",
    },
  ]);


  const [users, setUsers] = useState([
    {
      id: 1,
      firstName: "SA00000001",
      lastName: "John David",
      emailID: "John",
      role: "David",
      phoneNumber:"8940035906",
    },
  ]);

  const [fawateerRequest, setFawateerRequest] = useState([
    {
      id: 8,
      principal_xid: 2,
      transaction_date: "2024-10-07",
      transaction_amount: "2000.00",
      transactionStatus: "Approved",
      makerComment: "This is a sample comment for the transactio",
      checkerComment: "This is a sample comment for the transaction",
      spportFile_path: "public\\spportFile_path\\screenshot_2024_02_15_152810.png",
      clientReference_id: "BH00000001",
      firstName: "jayesh",
      lastName: "jain ",
      mobileNumber: "+919819906537",
      emailAddress: "jayeshkjain6@gmail.com",
      maker: {
          firstName: "Faisal",
          lastName: "Aljalahma",
          emailAddress: "admin@tanami.com",
          ISDcode: "+973",
          mobileNumber: "3633133"
      }
    },
    {
      id: 8,
      principal_xid: 2,
      transaction_date: "2024-10-07",
      transaction_amount: "2000.00",
      transactionStatus: "Approved",
      makerComment: "This is a sample comment for the transactio",
      checkerComment: "This is a sample comment for the transaction",
      spportFile_path: "public\\spportFile_path\\screenshot_2024_02_15_152810.png",
      clientReference_id: "BH00000001",
      firstName: "jayesh",
      lastName: "jain ",
      mobileNumber: "+919819906537",
      emailAddress: "jayeshkjain6@gmail.com",
      maker: {
          firstName: "Faisal",
          lastName: "Aljalahma",
          emailAddress: "admin@tanami.com",
          ISDcode: "+973",
          mobileNumber: "3633133"
      }
    },
    {
      id: 8,
      principal_xid: 2,
      transaction_date: "2024-10-07",
      transaction_amount: "2000.00",
      transactionStatus: "Approved",
      makerComment: "This is a sample comment for the transactio",
      checkerComment: "This is a sample comment for the transaction",
      spportFile_path: "public\\spportFile_path\\screenshot_2024_02_15_152810.png",
      clientReference_id: "BH00000001",
      firstName: "jayesh",
      lastName: "jain ",
      mobileNumber: "+919819906537",
      emailAddress: "jayeshkjain6@gmail.com",
      maker: {
          firstName: "Faisal",
          lastName: "Aljalahma",
          emailAddress: "admin@tanami.com",
          ISDcode: "+973",
          mobileNumber: "3633133"
      }
    },
    {
      id: 8,
      principal_xid: 2,
      transaction_date: "2024-10-07",
      transaction_amount: "2000.00",
      transactionStatus: "Approved",
      makerComment: "This is a sample comment for the transactio",
      checkerComment: "This is a sample comment for the transaction",
      spportFile_path: "public\\spportFile_path\\screenshot_2024_02_15_152810.png",
      clientReference_id: "BH00000001",
      firstName: "jayesh",
      lastName: "jain ",
      mobileNumber: "+919819906537",
      emailAddress: "jayeshkjain6@gmail.com",
      maker: {
          firstName: "Faisal",
          lastName: "Aljalahma",
          emailAddress: "admin@tanami.com",
          ISDcode: "+973",
          mobileNumber: "3633133"
      }
    },
  ]);

  const [approveHistory, setApproveHistory] = useState([
    {
      "id": 1,
      "principal_xid": 2,
      "transaction_date": "2024-10-07",
      "transaction_amount": "2000.00",
      "transactionStatus": "Pending",
      "makerComment": null,
      "checkerComment": null,
      "spportFile_path": null,
      "clientReference_id": "BH00000001",
      "firstName": "jayesh",
      "lastName": "jain",
      "mobileNumber": "+919819906537",
      "emailAddress": "jayeshkjain6@gmail.com",
      "maker": {
          "firstName": "Faisal",
          "lastName": "Aljalahma",
          "emailAddress": "admin@tanami.com",
          "ISDcode": "+973",
          "mobileNumber": "3633133"
      }
    },
  ]);

  const [InvestorWallet, setInvestorWallet] = useState(null);

  // ==============[ prod state ]===============================
  const [IODetails, setIODetails] = useState(null);
  const [isIOloading, setIOloading] = useState(false);

  return (
    <GlobalStateContext.Provider
      value={{
        isAuthenticate,
        setIsAuthenticate,
        memberIfo,
        setMemberInfo,
        communityMembers,
        setCommityMembers,
        sponser,
        setSponser,
        colorMode,
        toggleColorMode,
        slideFromRight,
        setSlideFormRight,
        InvestorDetails,
        setInvestorDetails,
        investment,
        setInvestment,
        rateExchange,
        setRateExchange,
        pendingRequest,
        setPendingRequest,
        viewHistory,
        setViewHistory,
        investmentType,
        setInvestmentType,
        investorRequest,
        setInvestorRequest,
        investorTransaction,
        setInvestorTransaction,
        upgradeHistory,
        setUpgradeHistory,
        deleteHistory,
        setDeleteHistory,
        deleteRequest,
        setDeleteRequest,
        viewIO,
        setViewIO,
        create,
        setCreate,
        keyMerits,
        setKeyMerits,
        iOArtifacts,
        setIOArtifacts,
        investors,
        setInvestors,
        IODetails,
        setIODetails,
        navDetails,
        setNavDetails,
        caseDetails,
        setCaseDetails,
        viewInvestor,
        setViewInvestor,
        transaction,
        setTransaction,
        depositRequest,
        setDepositRequest,
        depositHistory,
        setDepositHistory,
        bankInvestor,
        setBankInvestor,
        manageAcademy,
        setManageAcademy,
        manageVideo,
        setManageVideo,
        academicDocuments,
        setAcademicDocuments,
        iOArtifactsTwo,
        setIOArtifactsTwo,
        InvestorWallet,
        setInvestorWallet,
        isIOloading,
        setIOloading,
        users,
        setUsers,
        fawateerRequest,
        setFawateerRequest,
        approveHistory,
        setApproveHistory
      }}
    >
      {children}
    </GlobalStateContext.Provider>
  );
};
export default GlobalStateProvider;
