diff --git a/package-lock.json b/package-lock.json index e0d2d41..1adbe19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "framer-motion": "^11.5.5", "js-cookie": "^3.0.5", "libphonenumber-js": "^1.11.8", + "multiselect-react-dropdown": "^2.0.25", "react": "^18.2.0", "react-apexcharts": "^1.4.1", "react-beautiful-dnd": "^13.1.1", @@ -4845,6 +4846,14 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/multiselect-react-dropdown": { + "version": "2.0.25", + "resolved": "https://registry.npmjs.org/multiselect-react-dropdown/-/multiselect-react-dropdown-2.0.25.tgz", + "integrity": "sha512-z8kUSyBNOuV7vn4Dk35snzXWtIfTdSEEXhgDdLMvOmR+xJFx35vc1voUlSuOvrk3khb+hXC219Qs9szOvNm25Q==", + "peerDependencies": { + "react": "^16.7.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", diff --git a/package.json b/package.json index 2ec5e70..1205e17 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "framer-motion": "^11.5.5", "js-cookie": "^3.0.5", "libphonenumber-js": "^1.11.8", + "multiselect-react-dropdown": "^2.0.25", "react": "^18.2.0", "react-apexcharts": "^1.4.1", "react-beautiful-dnd": "^13.1.1", diff --git a/src/Components/Cards/BlueCard.jsx b/src/Components/Cards/BlueCard.jsx index 2e300bd..c5e06be 100644 --- a/src/Components/Cards/BlueCard.jsx +++ b/src/Components/Cards/BlueCard.jsx @@ -1,24 +1,24 @@ -import { Box, Stack, Text, } from '@chakra-ui/react' -import React from 'react' -import { MdGroups } from 'react-icons/md' +import { Box, Stack, Text, Link, Badge } from '@chakra-ui/react'; +import React from 'react'; +import { MdGroups } from 'react-icons/md'; -function BlueCard() { +function BlueCard({blueCardData}) { return ( - + - {item.title} + {blueCardData.title} - {item.count} + {blueCardData.count} - {item.linkText} + {blueCardData.buttonText} - ) + ); } -export default BlueCard \ No newline at end of file +export default BlueCard; diff --git a/src/Contexts/GlobalStateProvider.jsx b/src/Contexts/GlobalStateProvider.jsx index 2f62224..1e7ca2c 100644 --- a/src/Contexts/GlobalStateProvider.jsx +++ b/src/Contexts/GlobalStateProvider.jsx @@ -12,14 +12,14 @@ import { AiOutlineFileGif } from "react-icons/ai"; import { MdOutlineNoFood } from "react-icons/md"; import { LuFuel } from "react-icons/lu"; import { GoGift } from "react-icons/go"; -import { FaWifi } from "react-icons/fa"; +import { FaWifi } from "react-icons/fa"; import { SiBookstack } from "react-icons/si"; import Food from "../assets/icons/Food.png"; import Fuel from "../assets/icons/Fuel.png"; import Gift from "../assets/icons/gift.png"; -import books from "../assets/icons/bookStack.png" -import telecom from "../assets/icons/telecom.png" -import gadget from "../assets/icons/gadget.png" +import books from "../assets/icons/bookStack.png"; +import telecom from "../assets/icons/telecom.png"; +import gadget from "../assets/icons/gadget.png"; const getRandomDate = (start, end) => { const date = new Date( start.getTime() + Math.random() * (end.getTime() - start.getTime()) @@ -1472,210 +1472,288 @@ const GlobalStateProvider = ({ children }) => { const [digital, setDigital] = useState([ { id: 1, - "orderid": "#451245", - "laodStatus": "Fully Loaded", - "dateTime": "10 June 2024, 10am", - "totalvaluation": "₹ 70,000", - "activationStatus": "Active", - "CardDeliveryStatus": "Delivered", - "quantity": "500" + orderid: "#451245", + laodStatus: "Fully Loaded", + dateTime: "10 June 2024, 10am", + totalvaluation: "₹ 70,000", + activationStatus: "Active", + CardDeliveryStatus: "Delivered", + quantity: "500", }, { id: 2, - "orderid": "#451245", - "laodStatus": "Fully Loaded", - "dateTime": "10 June 2024, 10am", - "totalvaluation": "₹ 70,000", - "activationStatus": "Active", - "CardDeliveryStatus": "Not Delivered", - "quantity": "500" + orderid: "#451245", + laodStatus: "Fully Loaded", + dateTime: "10 June 2024, 10am", + totalvaluation: "₹ 70,000", + activationStatus: "Active", + CardDeliveryStatus: "Not Delivered", + quantity: "500", }, { id: 3, - "orderid": "#451245", - "laodStatus": "Fully Loaded", - "dateTime": "10 June 2024, 10am", - "totalvaluation": "₹ 70,000", - "activationStatus": "Activate", - "CardDeliveryStatus": "Delivered", - "quantity": "500" + orderid: "#451245", + laodStatus: "Fully Loaded", + dateTime: "10 June 2024, 10am", + totalvaluation: "₹ 70,000", + activationStatus: "Activate", + CardDeliveryStatus: "Delivered", + quantity: "500", }, { id: 3, - "orderid": "#451245", - "laodStatus": "Fully Loaded", - "dateTime": "10 June 2024, 10am", - "totalvaluation": "₹ 70,000", - "activationStatus": "Partially Active", - "CardDeliveryStatus": "Partially Delivered", - "quantity": "500" - + orderid: "#451245", + laodStatus: "Fully Loaded", + dateTime: "10 June 2024, 10am", + totalvaluation: "₹ 70,000", + activationStatus: "Partially Active", + CardDeliveryStatus: "Partially Delivered", + quantity: "500", }, { id: 4, - "orderid": "#451245", - "laodStatus": "Fully Loaded", - "dateTime": "10 June 2024, 10am", - "totalvaluation": "₹ 70,000", - "activationStatus": "Active", - "CardDeliveryStatus": "Not Delivered", - "quantity": "500" + orderid: "#451245", + laodStatus: "Fully Loaded", + dateTime: "10 June 2024, 10am", + totalvaluation: "₹ 70,000", + activationStatus: "Active", + CardDeliveryStatus: "Not Delivered", + quantity: "500", }, { id: 5, - "orderid": "#451245", - "laodStatus": "Fully Loaded", - "dateTime": "10 June 2024, 10am", - "totalvaluation": "₹ 70,000", - "activationStatus": "Partially Active", - "CardDeliveryStatus": "Not Delivered", - "quantity": "500" + orderid: "#451245", + laodStatus: "Fully Loaded", + dateTime: "10 June 2024, 10am", + totalvaluation: "₹ 70,000", + activationStatus: "Partially Active", + CardDeliveryStatus: "Not Delivered", + quantity: "500", }, { id: 6, - "orderid": "#451245", - "laodStatus": "Fully Loaded", - "dateTime": "10 June 2024, 10am", - "totalvaluation": "₹ 70,000", - "activationStatus": "Active", - "CardDeliveryStatus": "Delivered", - "quantity": "500" + orderid: "#451245", + laodStatus: "Fully Loaded", + dateTime: "10 June 2024, 10am", + totalvaluation: "₹ 70,000", + activationStatus: "Active", + CardDeliveryStatus: "Delivered", + quantity: "500", }, { id: 7, - "orderid": "#451245", - "laodStatus": "Fully Loaded", - "dateTime": "10 June 2024, 10am", - "totalvaluation": "₹ 70,000", - "activationStatus": "Activate", - "CardDeliveryStatus": "Delivered", - "quantity": "500" + orderid: "#451245", + laodStatus: "Fully Loaded", + dateTime: "10 June 2024, 10am", + totalvaluation: "₹ 70,000", + activationStatus: "Activate", + CardDeliveryStatus: "Delivered", + quantity: "500", }, { id: 8, - "orderid": "#451245", - "laodStatus": "Fully Loaded", - "dateTime": "10 June 2024, 10am", - "totalvaluation": "₹ 70,000", - "activationStatus": "Activate", - "CardDeliveryStatus": "Delivered", - "quantity": "500" + orderid: "#451245", + laodStatus: "Fully Loaded", + dateTime: "10 June 2024, 10am", + totalvaluation: "₹ 70,000", + activationStatus: "Activate", + CardDeliveryStatus: "Delivered", + quantity: "500", }, - ]) + ]); - + // supprt and ticket + + const [SupportAndTicket, setSupportAndTicket] = useState([ + { + TicketID: 124589, + Subject: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi.", + Status: "On hold", + LastUpdate: "Jun 10, 2024", + Support: "Reethik thota", + }, + { + TicketID: 124589, + Subject: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi.", + Status: "On hold", + LastUpdate: "Jun 10, 2024", + Support: "Reethik thota", + }, + { + TicketID: 124589, + Subject: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi.", + Status: "On hold", + LastUpdate: "Jun 10, 2024", + Support: "Reethik thota", + }, + { + TicketID: 124589, + Subject: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi.", + Status: "On hold", + LastUpdate: "Jun 10, 2024", + Support: "Reethik thota", + }, + { + TicketID: 124589, + Subject: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi.", + Status: "Inactive", + LastUpdate: "Jun 10, 2024", + Support: "Reethik thota", + }, + { + TicketID: 124589, + Subject: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi.", + Status: "Inactive", + LastUpdate: "Jun 10, 2024", + Support: "Reethik thota", + }, + { + TicketID: 124589, + Subject: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi.", + Status: "In progress", + LastUpdate: "Jun 10, 2024", + Support: "Reethik thota", + }, + { + TicketID: 124589, + Subject: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi.", + Status: "In progress", + LastUpdate: "Jun 10, 2024", + Support: "Reethik thota", + }, + { + TicketID: 124589, + Subject: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi.", + Status: "In progress", + LastUpdate: "Jun 10, 2024", + Support: "Reethik thota", + }, + ]); const [AdvanceExpenseRequest, setAdvanceExpenseRequest] = useState([ { id: 1, ReportName: "Advance expense report 2024", ReportBy: { - profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profImage: + "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", profName: "Raju", }, ReportAmount: "₹ 50000", DateTime: "10 June, 2924 10 am", Approver: "Reethik thota", Disburser: "Manav sain", - Action: "View" + Action: "View", }, { id: 2, ReportName: "Advance expense report 2024", ReportBy: { - profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profImage: + "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", profName: "Raju", }, ReportAmount: "₹ 50000", DateTime: "10 June, 2924 10 am", Approver: "Reethik thota", Disburser: "Manav sain", - Action: "View" + Action: "View", }, { id: 3, ReportName: "Advance expense report 2024", ReportBy: { - profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profImage: + "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", profName: "Raju", }, ReportAmount: "₹ 50000", DateTime: "10 June, 2924 10 am", Approver: "Reethik thota", Disburser: "Manav sain", - Action: "View" + Action: "View", }, { id: 4, ReportName: "Advance expense report 2024", ReportBy: { - profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profImage: + "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", profName: "Raju", }, ReportAmount: "₹ 50000", DateTime: "10 June, 2924 10 am", Approver: "Reethik thota", Disburser: "Manav sain", - Action: "View" + Action: "View", }, { id: 5, ReportName: "Advance expense report 2024", ReportBy: { - profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profImage: + "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", profName: "Raju", }, ReportAmount: "₹ 50000", DateTime: "10 June, 2924 10 am", Approver: "Reethik thota", Disburser: "Manav sain", - Action: "View" + Action: "View", }, - ]) + ]); const [AdvanceExpenseRequestView, setAdvanceExpenseRequestView] = useState([ { - "DateTime": "10 June, 2924 10 am", - "Merchant": "Dine in", - "Category": "Food", - "Paymentmode": "Expense card", - "ReimburseAmount": "₹ 50000", - "Bills": "", - "Disburser": "Manav sain", - "Action": "" + DateTime: "10 June, 2924 10 am", + Merchant: "Dine in", + Category: "Food", + Paymentmode: "Expense card", + ReimburseAmount: "₹ 50000", + Bills: "", + Disburser: "Manav sain", + Action: "", }, { - "DateTime": "10 June, 2924 10 am", - "Merchant": "Airtel postpaid", - "Category": "Telecom", - "Paymentmode": "Expense card", - "ReimburseAmount": "₹ 50000", - "Bills": "", - "Disburser": "Manav sain", - "Action": "" + DateTime: "10 June, 2924 10 am", + Merchant: "Airtel postpaid", + Category: "Telecom", + Paymentmode: "Expense card", + ReimburseAmount: "₹ 50000", + Bills: "", + Disburser: "Manav sain", + Action: "", }, { - "DateTime": "10 June, 2924 10 am", - "Merchant": "Lorem ipsme", - "Category": "Fuel", - "Paymentmode": "Expense card", - "ReimburseAmount": "₹ 50000", - "Bills": "", - "Disburser": "Manav sain", - "Action": "" + DateTime: "10 June, 2924 10 am", + Merchant: "Lorem ipsme", + Category: "Fuel", + Paymentmode: "Expense card", + ReimburseAmount: "₹ 50000", + Bills: "", + Disburser: "Manav sain", + Action: "", }, { - "DateTime": "10 June, 2924 10 am", - "Merchant": "Dine in", - "Category": "Food", - "Paymentmode": "Expense card", - "ReimburseAmount": "₹ 50000", - "Bills": "", - "Disburser": "Manav sain", - "Action": "" + DateTime: "10 June, 2924 10 am", + Merchant: "Dine in", + Category: "Food", + Paymentmode: "Expense card", + ReimburseAmount: "₹ 50000", + Bills: "", + Disburser: "Manav sain", + Action: "", }, - ]) - + ]); const [ApplicationStatus, setApplicationStatus] = useState([ { @@ -1788,100 +1866,164 @@ const GlobalStateProvider = ({ children }) => { }, ]); - const [walletProgram, setWalletProgram] = useState( - [ + const [walletProgram, setWalletProgram] = useState([ { id: 1, walletName: [{ name: "Food", icon: Food }], - WalletType : "Prefilled", - department :"sales", - status :"Active", - WalletAmount :"₹ 50,000", - CreatedOn :"Jan 12, 2022", - CreatedBy:"Jenny wilson" + WalletType: "Prefilled", + department: "sales", + status: "Active", + WalletAmount: "₹ 50,000", + CreatedOn: "Jan 12, 2022", + CreatedBy: "Jenny wilson", }, { id: 2, walletName: [{ name: "Fuel", icon: Fuel }], - WalletType : "Prefilled", - department :"sales", - status :"Active", - WalletAmount :"₹ 50,000", - CreatedOn :"Jan 12, 2022", - CreatedBy:"Jenny wilson" + WalletType: "Prefilled", + department: "sales", + status: "Active", + WalletAmount: "₹ 50,000", + CreatedOn: "Jan 12, 2022", + CreatedBy: "Jenny wilson", }, { id: 3, walletName: [{ name: "Gift", icon: Gift }], - WalletType : "Prefilled", - department :"sales", - status :"Active", - WalletAmount :"₹ 50,000", - CreatedOn :"Jan 12, 2022", - CreatedBy:"Jenny wilson" + WalletType: "Prefilled", + department: "sales", + status: "Active", + WalletAmount: "₹ 50,000", + CreatedOn: "Jan 12, 2022", + CreatedBy: "Jenny wilson", }, { id: 4, walletName: [{ name: "Telecom", icon: telecom }], - WalletType : "Prefilled", - department :"sales", - status :"Saved as draft", - WalletAmount :"₹ 50,000", - CreatedOn :"Jan 12, 2022", - CreatedBy:"Jenny wilson" + WalletType: "Prefilled", + department: "sales", + status: "Saved as draft", + WalletAmount: "₹ 50,000", + CreatedOn: "Jan 12, 2022", + CreatedBy: "Jenny wilson", }, { id: 5, walletName: [{ name: "Books & periodicals", icon: books }], - WalletType : "Prefilled", - department :"sales", - status :"Active", - WalletAmount :"₹ 50,000", - CreatedOn :"Jan 12, 2022", - CreatedBy:"Jenny wilson" + WalletType: "Prefilled", + department: "sales", + status: "Active", + WalletAmount: "₹ 50,000", + CreatedOn: "Jan 12, 2022", + CreatedBy: "Jenny wilson", }, { id: 6, walletName: [{ name: "Learning & development", icon: books }], - WalletType : "Prefilled", - department :"sales", - status :"Active", - WalletAmount :"₹ 50,000", - CreatedOn :"Jan 12, 2022", - CreatedBy:"Jenny wilson" + WalletType: "Prefilled", + department: "sales", + status: "Active", + WalletAmount: "₹ 50,000", + CreatedOn: "Jan 12, 2022", + CreatedBy: "Jenny wilson", }, { id: 7, walletName: [{ name: "Gadget & equipment", icon: gadget }], - WalletType : "Prefilled", - department :"sales", - status :"Active", - WalletAmount :"₹ 50,000", - CreatedOn :"Jan 12, 2022", - CreatedBy:"Jenny wilson" + WalletType: "Prefilled", + department: "sales", + status: "Active", + WalletAmount: "₹ 50,000", + CreatedOn: "Jan 12, 2022", + CreatedBy: "Jenny wilson", }, { id: 8, walletName: [{ name: "Telecom", icon: telecom }], - WalletType : "Prefilled", - department :"sales", - status :"Pending", - WalletAmount :"₹ 50,000", - CreatedOn :"Jan 12, 2022", - CreatedBy:"Jenny wilson" + WalletType: "Prefilled", + department: "sales", + status: "Pending", + WalletAmount: "₹ 50,000", + CreatedOn: "Jan 12, 2022", + CreatedBy: "Jenny wilson", }, { id: 9, walletName: [{ name: "Food", icon: Food }], - WalletType : "Prefilled", - department :"sales", - status :"Pending", - WalletAmount :"₹ 50,000", - CreatedOn :"Jan 12, 2022", - CreatedBy:"Jenny wilson" + WalletType: "Prefilled", + department: "sales", + status: "Pending", + WalletAmount: "₹ 50,000", + CreatedOn: "Jan 12, 2022", + CreatedBy: "Jenny wilson", }, - ] -); + ]); + + const [voucher, setVoucher] = useState([ + { + id: 1, + DateTime: "Jan 12, 2022, 10 am", + EmployeesDepartment: "250 employees", + TotalAmount: "₹ 50,000", + OrderStatus: "Scheduled", + }, + { + id: 2, + DateTime: "Jan 12, 2022, 10 am", + EmployeesDepartment: "250 employees", + TotalAmount: "₹ 50,000", + OrderStatus: "Scheduled", + }, + { + id: 3, + DateTime: "Jan 12, 2022, 10 am", + EmployeesDepartment: "250 employees", + TotalAmount: "₹ 50,000", + OrderStatus: "Scheduled", + }, + { + id: 4, + DateTime: "Jan 12, 2022, 10 am", + EmployeesDepartment: "250 employees", + TotalAmount: "₹ 50,000", + OrderStatus: "Scheduled", + }, + { + id: 5, + DateTime: "Jan 12, 2022, 10 am", + EmployeesDepartment: "250 employees", + TotalAmount: "₹ 50,000", + OrderStatus: "Completed", + }, + { + id: 6, + DateTime: "Jan 12, 2022, 10 am", + EmployeesDepartment: "250 employees", + TotalAmount: "₹ 50,000", + OrderStatus: "Completed", + }, + { + id: 7, + DateTime: "Jan 12, 2022, 10 am", + EmployeesDepartment: "250 employees", + TotalAmount: "₹ 50,000", + OrderStatus: "Completed", + }, + { + id: 8, + DateTime: "Jan 12, 2022, 10 am", + EmployeesDepartment: "250 employees", + TotalAmount: "₹ 50,000", + OrderStatus: "Completed", + }, + { + id: 9, + DateTime: "Jan 12, 2022, 10 am", + EmployeesDepartment: "250 employees", + TotalAmount: "₹ 50,000", + OrderStatus: "Completed", + }, + ]); return ( { setEmployeePermissions, reimbursementStatus, setReimbursementStatus, + voucher, advanceStatus, setAdvanceStatus, digital, @@ -1910,7 +2053,9 @@ const GlobalStateProvider = ({ children }) => { setAdvanceExpenseRequest, AdvanceExpenseRequestView, setAdvanceExpenseRequestView, - walletProgram + walletProgram, + SupportAndTicket, + setSupportAndTicket, }} > {children} diff --git a/src/Pages/ManageHumanResource/Approvers.jsx b/src/Pages/ManageHumanResource/Approvers.jsx index 2491bf2..6421477 100644 --- a/src/Pages/ManageHumanResource/Approvers.jsx +++ b/src/Pages/ManageHumanResource/Approvers.jsx @@ -1,15 +1,543 @@ -import { Box } from "@chakra-ui/react"; -import React from "react"; +import { + Box, Grid, Heading, Menu, MenuButton, MenuItem, MenuList, VStack, + Button, + Image, + Input, + InputGroup, + InputLeftElement, + Text, + Tag, +} from "@chakra-ui/react"; +import React, { useContext, useEffect, useState } from "react"; import MiniHeader from "../../Components/MiniHeader"; +import BlueCard from "../../Components/Cards/BlueCard"; + +import { LuListFilter } from "react-icons/lu"; +import NormalTable from "../../Components/DataTable/NormalTable"; +import { FaArrowUpFromBracket } from "react-icons/fa6"; +import pdfIcon from "../../assets/pdfIcon.svg"; +import ExcelIcon from "../../assets/ExcelIcon.svg"; +import { AiOutlineCalendar } from "react-icons/ai"; +import { IoMdArrowDropdown } from "react-icons/io"; +import { BsArrowsAngleExpand, BsFilterRight } from "react-icons/bs"; +import { ChevronDownIcon, SearchIcon } from "@chakra-ui/icons"; +import GlobalStateContext from "../../Contexts/GlobalStateContext"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; +import { useNavigate } from "react-router-dom"; const Approvers = () => { + + const { reimbursementStatus } = useContext(GlobalStateContext); + const { advanceStatus } = useContext(GlobalStateContext); + const [isLoading, setIsLoading] = useState(false); + const [searchTerm, setSearchTerm] = useState(""); + const navigate = useNavigate(); + + useEffect(() => { + // Set isLoading to true + setIsLoading(true); + + // Simulate a 3-second delay + const timer = setTimeout(() => { + setIsLoading(false); // Set isLoading to false after 3 seconds + }, 500); + + // Cleanup the timer when the component unmounts or when the useEffect re-runs + return () => clearTimeout(timer); + }, []); // Empty dependency array means this effect runs once after the component mounts + + // ===============================[ Table Header ] + const tableHeadRow = [ + "Report name", + "Report by", + "Report amount", + "Date & time", + "Order Status", + "Approver", + "Disburser", + ]; + + const tableHeadRowAdvance = [ + "Report name", + "Report by", + "Report amount", + "Date & time", + "Order Status", + "Approver", + ]; + + // const extractedArray = reportsHistory.map((item)=>({ })) + + const extractedArray = reimbursementStatus.map((item, index) => ({ + "Report name": item?.reportName, + "Report by": item?.reportBy, + "Report amount": item?.reportAmount, + "Date & time": item?.dateTime, + "Order Status": ( + + {item?.orderStatus} + + ), + Approver: item?.approver, + Disburser: item?.disburser, + })); + + const extractedArrayAdvance = advanceStatus.map((item, index) => ({ + "Report name": item?.reportName, + "Report by": item?.reportBy, + "Report amount": item?.reportAmount, + "Date & time": item?.dateTime, + "Order Status": ( + + {item?.orderStatus} + + ), + Approver: item?.approver, + })); + + const requestItems = [ + { + backgroundColor: "#3725EA", + title: "REIMBURSEMENT REQUEST", + count: 200, + linkText: "View Requests", + }, + { + backgroundColor: "#C33FAD", + title: "ADVANCE EXPENSE REQUEST", + count: 200, + linkText: "View Requests", + }, + { + backgroundColor: "#3725EA", + title: "WALLET APPROVAL REQUEST", + count: 200, + linkText: "View Requests", + }, + ]; + + const gridItemsData = [ + { + backgroundColor: "#218F001A", + iconColor: "#00A438", + title: "Bills for approval", + count: 50, + buttonBg: "#FCA1001A", + buttonBorder: "#FCA100", + buttonText: "Pending requests", + badgeText: "20 New", + badgeColor: "#3725EA", + viewTextColor: "#6311CB", + }, + { + backgroundColor: "#218F001A", + iconColor: "#00A438", + title: "Bills for pending", + count: 50, + buttonBg: "#FCA1001A", + buttonBorder: "#FCA100", + buttonText: "Pending requests", + badgeText: "20 New", + badgeColor: "#3725EA", + viewTextColor: "#6311CB", + }, + { + backgroundColor: "#218F001A", + iconColor: "#00A438", + title: "Active expense wallets", + count: 50, + buttonBg: "#3725EA1A", + buttonBorder: "#3725EA", + buttonText: "View", + viewTextColor: "#6311CB", + hideBadge: true, + }, + ]; + + const blueCardData = [ + { + backgroundColor: "#6311CB", + iconColor: "#00A438", + title: "Pending reimbursement request", + count: 200, + buttonBg: "#FCA1001A", + buttonBorder: "#FCA100", + buttonText: "View requests", + badgeText: "20 New", + badgeColor: "#3725EA", + viewTextColor: "#6311CB", + }, + { + backgroundColor: "#C33FAD", + iconColor: "#00A438", + title: "Pending wallet requests ", + count: 50, + buttonBg: "#FCA1001A", + buttonBorder: "#FCA100", + buttonText: "View requests", + badgeText: "20 New", + badgeColor: "#3725EA", + viewTextColor: "#6311CB", + }, + ] + return ( - + + + + + {blueCardData.map((item, index) => ( + + ))} + + + + {/* dhbfdbf */} + + + + + + Reimbursement status + + + + } + rightIcon={} + fontSize={"xs"} + colorScheme="gray" + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Export + + + + Export as PDF + + + Export as Excel + + + + + + Time Period : + + + + Feb 20 - Jan 30, 2024{" "} + + + + + + + +
+ + + + } + rightIcon={} + fontSize={"xs"} + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Sort + + + Ascending + Descending + Recently Viewed + Recently Added + + + + + + + + + setSearchTerm(e.target.value)} + /> + + + } + rightIcon={} + fontSize={"xs"} + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Filter + + + Ascending + Descending + Recently Viewed + Recently Added + + + + navigate("/reimbursement-request")} + as={Button} + color={"#6311CB"} + size={18} + cursor={"pointer"} + /> + + + + +
+ + + + + + Advance expense status + + + + } + rightIcon={} + fontSize={"xs"} + colorScheme="gray" + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Export + + + + Export as PDF + + + Export as Excel + + + + + + Time Period : + + + + Feb 20 - Jan 30, 2024{" "} + + + + + + + +
+ + + + } + rightIcon={} + fontSize={"xs"} + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Sort + + + Ascending + Descending + Recently Viewed + Recently Added + + + + + + + + + setSearchTerm(e.target.value)} + /> + + + } + rightIcon={} + fontSize={"xs"} + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Filter + + + Ascending + Descending + Recently Viewed + Recently Added + + + navigate("/reimbursement-request")} + as={Button} + color={"#6311CB"} + size={18} + cursor={"pointer"} + /> + + + + +
); }; diff --git a/src/Pages/OptiFiiExpense/OptiFiiExpenseDashboard.jsx b/src/Pages/OptiFiiExpense/OptiFiiExpenseDashboard.jsx index c677e92..93a35a6 100644 --- a/src/Pages/OptiFiiExpense/OptiFiiExpenseDashboard.jsx +++ b/src/Pages/OptiFiiExpense/OptiFiiExpenseDashboard.jsx @@ -39,6 +39,7 @@ import ExcelIcon from "../../assets/ExcelIcon.svg"; import { AiOutlineCalendar } from "react-icons/ai"; import { IoMdArrowDropdown } from "react-icons/io"; import { BsFilterRight } from "react-icons/bs"; +import BlueCard from "../../Components/Cards/BlueCard"; const OptiFiiExpenseDashboard = () => { const { reimbursementStatus } = useContext(GlobalStateContext); @@ -96,8 +97,8 @@ const OptiFiiExpenseDashboard = () => { item?.orderStatus === "Approved" ? "#027A48" : item?.orderStatus === "Fully reimbursed" - ? "#3725EA" - : "red" + ? "#3725EA" + : "red" } > {item?.orderStatus} @@ -121,8 +122,8 @@ const OptiFiiExpenseDashboard = () => { item?.orderStatus === "Approved" ? "#027A48" : item?.orderStatus === "Fully reimbursed" - ? "#3725EA" - : "red" + ? "#3725EA" + : "red" } > {item?.orderStatus} @@ -190,46 +191,44 @@ const OptiFiiExpenseDashboard = () => { }, ]; + + const blueCardData = [ + { + backgroundColor: "#6311CB", + iconColor: "#00A438", + title: "Bills for pending", + count: 50, + buttonBg: "#FCA1001A", + buttonBorder: "#FCA100", + buttonText: "Pending requests", + badgeText: "20 New", + badgeColor: "#3725EA", + viewTextColor: "#6311CB", + }, + { + backgroundColor: "#C33FAD", + iconColor: "#00A438", + title: "Bills for pending", + count: 50, + buttonBg: "#FCA1001A", + buttonBorder: "#FCA100", + buttonText: "Pending requests", + badgeText: "20 New", + badgeColor: "#3725EA", + viewTextColor: "#6311CB", + }, + ] + + return ( - {requestItems.map((item, index) => ( - - - - - - - - {item.title} - - - - {item.count} - - - - - - - - {item.linkText} - - - + {blueCardData.map((item, index) => ( + ))} - + {gridItemsData.map((item, index) => ( @@ -473,6 +472,7 @@ const OptiFiiExpenseDashboard = () => { isLoading={isLoading} /> + {
+ + - + )} {activeStep === 1 && ( diff --git a/src/Pages/OptiFiiExpense/wallet/OutOfPoket.jsx b/src/Pages/OptiFiiExpense/wallet/OutOfPoket.jsx index bbf53e7..a3eed27 100644 --- a/src/Pages/OptiFiiExpense/wallet/OutOfPoket.jsx +++ b/src/Pages/OptiFiiExpense/wallet/OutOfPoket.jsx @@ -16,16 +16,31 @@ import { WrapItem, Button, useToast, + Checkbox, + Stack, + CheckboxGroup, + Text, + RadioGroup, + Radio, } from "@chakra-ui/react"; -import { AddIcon } from "@chakra-ui/icons"; +import { AddIcon, ChevronDownIcon } from "@chakra-ui/icons"; import React, { useState } from "react"; import dayjs from "dayjs"; +import { CiCircleInfo } from "react-icons/ci"; const OutOfPoket = ({ register, formState }) => { const [selectedDepartments, setSelectedDepartments] = useState([]); const [selectedTimes, setSelectedTimes] = useState([]); + const [transaction, setTransaction] = useState([]); + const [transactionRule, setTransactionRule] = useState("none"); + const [categories, setCategories] = useState(["Food", "Fuel"]); + const [selectedCategories, setSelectedCategories] = useState([]); + const [inputValue, setInputValue] = useState(""); + const toast = useToast(); + const transactionTags = ["Food", "Fuel"]; + const departments = ["Finance", "HR", "Marketing", "Engineering"]; const options = [ { @@ -50,6 +65,40 @@ const OutOfPoket = ({ register, formState }) => { }, ]; + const availableCategories = [ + "Entertainment", + "Groceries", + "Fuel", + "Shopping", + "Food", + "Utilities", + ]; + + const handleCategoryRemove = (categoryToRemove) => { + setCategories( + categories.filter((category) => category !== categoryToRemove) + ); + }; + + const handleCategoryAdd = (categoryToAdd) => { + if (!categories.includes(categoryToAdd)) { + setCategories([...categories, categoryToAdd]); + } + }; + + const addCategory = () => { + if (inputValue && !selectedCategories.includes(inputValue)) { + setSelectedCategories([...selectedCategories, inputValue]); + setInputValue(""); + } + }; + + const removeCategory = (categoryToRemove) => { + setSelectedCategories( + selectedCategories.filter((category) => category !== categoryToRemove) + ); + }; + const handleSelect = (time) => { if (!selectedTimes.includes(time)) { setSelectedTimes([...selectedTimes, time]); @@ -64,6 +113,17 @@ const OutOfPoket = ({ register, formState }) => { } }; + const handleRemoveTags = (time) => { + setSelectedTimes(selectedTimes.filter((t) => t !== time)); + }; + + const handleSelectChangeTags = (event) => { + const value = event.target.value; + if (value && !transactionTags.includes(value)) { + setSelectedDepartments([...transactionTags, value]); + } + }; + const handleRemove = (time) => { setSelectedTimes(selectedTimes.filter((t) => t !== time)); }; @@ -82,28 +142,37 @@ const OutOfPoket = ({ register, formState }) => { return (
- + - Wallet policy + + Wallet name + - Description + + Description +