diff --git a/src/components/RecentActivity.tsx b/src/components/RecentActivity.tsx deleted file mode 100644 index ff519fc..0000000 --- a/src/components/RecentActivity.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import React from 'react'; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; -import { ScrollArea } from '@/components/ui/scroll-area'; -import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; - -interface ActivityItem { - id: string; - type: 'order' | 'stock-in' | 'stock-out'; - description: string; - timestamp: string; - user?: { - name: string; - avatarUrl?: string; - }; -} - -const mockActivity: ActivityItem[] = [ - { - id: '1', - type: 'order', - description: 'New order #1001 placed by John Doe.', - timestamp: '2 hours ago', - user: { name: 'John Doe', avatarUrl: 'https://api.dicebear.com/7.x/initials/svg?seed=JD' }, - }, - { - id: '2', - type: 'stock-in', - description: '50 units of "Wireless Mouse" added to stock.', - timestamp: '5 hours ago', - }, - { - id: '3', - type: 'stock-out', - description: '10 units of "Mechanical Keyboard" booked out for delivery.', - timestamp: '1 day ago', - }, - { - id: '4', - type: 'order', - description: 'Order #1000 updated by Jane Smith.', - timestamp: '2 days ago', - user: { name: 'Jane Smith', avatarUrl: 'https://api.dicebear.com/7.x/initials/svg?seed=JS' }, - }, - { - id: '5', - type: 'stock-in', - description: '100 units of "USB-C Cable" received from supplier.', - timestamp: '3 days ago', - }, -]; - -export const RecentActivity = () => { - return ( - - - Recent Activity - Recent actions in your stock management system. - - - -
- {mockActivity.map((activity) => ( -
- - - {activity.user ? activity.user.name.substring(0, 2) : 'NA'} - -
-

{activity.description}

-

{activity.timestamp}

-
-
- ))} -
-
-
-
- ); -}; \ No newline at end of file diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index fb3ac2d..7d59a2a 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -1,13 +1,13 @@ import { StatCard } from '@/components/StatCard'; import { StockChart } from '@/components/StockChart'; -import { RecentActivity } from '@/components/RecentActivity'; +// import { RecentActivity } from '@/components/RecentActivity'; // Removed import import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { DollarSign, Package, ShoppingCart, Users } from 'lucide-react'; import { useQuery } from '@tanstack/react-query'; -import { fetchDashboardData, DashboardData } from '@/lib/api'; // Import DashboardData interface +import { fetchDashboardData, DashboardData } from '@/lib/api'; const Index = () => { - const { data, isLoading, error } = useQuery({ // Use DashboardData for typing + const { data, isLoading, error } = useQuery({ queryKey: ['dashboardData'], queryFn: fetchDashboardData, }); @@ -20,7 +20,6 @@ const Index = () => { return
Error loading dashboard data: {error.message}
; } - // Provide default values if data is undefined (though useQuery's type should handle this better now) const { totalStockValue, totalItems, totalOrders, totalCustomers } = data || { totalStockValue: 0, totalItems: 0, @@ -60,7 +59,7 @@ const Index = () => { />
- + {/* Changed col-span-4 to col-span-7 to make Stock Overview full width */} Stock Overview @@ -68,14 +67,7 @@ const Index = () => { - - - Recent Activity - - - - - + {/* Removed Recent Activity Card */}
);