diff --git a/src/app/dashboard/(user-dashboard)/_components/RecentSales.tsx b/src/app/dashboard/(user-dashboard)/_components/RecentSales.tsx index 59191a410..2c4e35d9d 100644 --- a/src/app/dashboard/(user-dashboard)/_components/RecentSales.tsx +++ b/src/app/dashboard/(user-dashboard)/_components/RecentSales.tsx @@ -1,85 +1,28 @@ -import React from "react"; +"use client"; +import React, { useEffect, useState } from "react"; + +import LoadingSpinner from "~/components/miscellaneous/loading-spinner"; import { Card } from "~/components/ui/card"; -type ProductData = { - name: string; - amount: string; - email: string; -}; +const RecentSales: React.FC = () => { + const [loading, setLoading] = useState(true); -type TopProductsProperties = { - data: ProductData[]; - gradients: string[]; - noOfSales: number; -}; + useEffect(() => { + const timer = setTimeout(() => { + setLoading(false); + }, 3000); // 3 seconds -const RecentSales: React.FC = ({ - data, - gradients, - noOfSales, -}) => { - return ( - -
-
-

- Recent Sales -

-

- You made {noOfSales} sales this month -

-
-
- + return ( + + {loading ? ( + + ) : ( +

No recent sales

+ )}
); }; diff --git a/src/app/dashboard/(user-dashboard)/_components/overview-sales/index.tsx b/src/app/dashboard/(user-dashboard)/_components/overview-sales/index.tsx index 95952ac66..688365366 100644 --- a/src/app/dashboard/(user-dashboard)/_components/overview-sales/index.tsx +++ b/src/app/dashboard/(user-dashboard)/_components/overview-sales/index.tsx @@ -1,11 +1,17 @@ +// import RecentSales from "~/app/dashboard/(user-dashboard)/_components/RecentSales"; +// import { +// data, +// gradients, +// } from "~/app/dashboard/(user-dashboard)/_components/salesData"; + +// export function OverviewSales() { +// return ( +// +// ); +// } + import RecentSales from "~/app/dashboard/(user-dashboard)/_components/RecentSales"; -import { - data, - gradients, -} from "~/app/dashboard/(user-dashboard)/_components/salesData"; export function OverviewSales() { - return ( - - ); + return ; } diff --git a/src/components/userDashboard/chartData.ts b/src/components/userDashboard/chartData.ts index 4314df6e2..54c9301b3 100644 --- a/src/components/userDashboard/chartData.ts +++ b/src/components/userDashboard/chartData.ts @@ -1,21 +1,20 @@ import { ChartConfig } from "~/components/ui/chart"; -export const generateRandomRevenue = () => - (Math.floor(Math.random() * 11) + 1) * 500; +export const generateZeroRevenue = () => 0; export const chartData = [ - { month: "January", revenue: generateRandomRevenue() }, - { month: "February", revenue: generateRandomRevenue() }, - { month: "March", revenue: generateRandomRevenue() }, - { month: "April", revenue: generateRandomRevenue() }, - { month: "May", revenue: generateRandomRevenue() }, - { month: "June", revenue: generateRandomRevenue() }, - { month: "July", revenue: generateRandomRevenue() }, - { month: "August", revenue: generateRandomRevenue() }, - { month: "September", revenue: generateRandomRevenue() }, - { month: "October", revenue: generateRandomRevenue() }, - { month: "November", revenue: generateRandomRevenue() }, - { month: "December", revenue: generateRandomRevenue() }, + { month: "January", revenue: generateZeroRevenue() }, + { month: "February", revenue: generateZeroRevenue() }, + { month: "March", revenue: generateZeroRevenue() }, + { month: "April", revenue: generateZeroRevenue() }, + { month: "May", revenue: generateZeroRevenue() }, + { month: "June", revenue: generateZeroRevenue() }, + { month: "July", revenue: generateZeroRevenue() }, + { month: "August", revenue: generateZeroRevenue() }, + { month: "September", revenue: generateZeroRevenue() }, + { month: "October", revenue: generateZeroRevenue() }, + { month: "November", revenue: generateZeroRevenue() }, + { month: "December", revenue: generateZeroRevenue() }, ]; export const chartConfig: ChartConfig = {