Skip to main content

Dashboard 2

title

Create a file at components/Dashboard.tsx:

import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import {
Users,
ShoppingCart,
DollarSign,
BarChart2,
Settings,
Home,
FileText,
Bell,
LogOut
} from "lucide-react"

export default function Component() {
return (
<div className="flex h-screen bg-gray-100">
{/* Sidebar */}
<aside className="w-64 bg-white shadow-md">
<div className="p-4">
<h2 className="text-2xl font-semibold text-gray-800">Admin Panel</h2>
</div>
<nav className="mt-6">
<Button variant="ghost" className="w-full justify-start px-4 py-2 text-left">
<Home className="mr-3 h-5 w-5" />
Dashboard
</Button>
<Button variant="ghost" className="w-full justify-start px-4 py-2 text-left">
<Users className="mr-3 h-5 w-5" />
Users
</Button>
<Button variant="ghost" className="w-full justify-start px-4 py-2 text-left">
<FileText className="mr-3 h-5 w-5" />
Reports
</Button>
<Button variant="ghost" className="w-full justify-start px-4 py-2 text-left">
<Bell className="mr-3 h-5 w-5" />
Notifications
</Button>
<Button variant="ghost" className="w-full justify-start px-4 py-2 text-left">
<Settings className="mr-3 h-5 w-5" />
Settings
</Button>
</nav>
</aside>

{/* Main Content */}
<div className="flex-1 flex flex-col overflow-hidden">
{/* Header */}
<header className="bg-white shadow-sm">
<div className="max-w-7xl mx-auto py-4 px-4 sm:px-6 lg:px-8 flex justify-between items-center">
<h1 className="text-2xl font-semibold text-gray-900">Dashboard</h1>
<div className="flex items-center">
<Input
type="search"
placeholder="Search..."
className="mr-4"
/>
<Button variant="outline">
<LogOut className="mr-2 h-4 w-4" />
Logout
</Button>
</div>
</div>
</header>

{/* Dashboard Content */}
<main className="flex-1 overflow-x-hidden overflow-y-auto bg-gray-100">
<div className="container mx-auto px-6 py-8">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Total Users</CardTitle>
<Users className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">1,234</div>
<p className="text-xs text-muted-foreground">+10% from last month</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Total Orders</CardTitle>
<ShoppingCart className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">567</div>
<p className="text-xs text-muted-foreground">+5% from last week</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Revenue</CardTitle>
<DollarSign className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">$12,345</div>
<p className="text-xs text-muted-foreground">+15% from last month</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Analytics</CardTitle>
<BarChart2 className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">87%</div>
<p className="text-xs text-muted-foreground">Website traffic increase</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Active Tasks</CardTitle>
<Settings className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">13</div>
<p className="text-xs text-muted-foreground">5 tasks overdue</p>
</CardContent>
</Card>
</div>
</div>
</main>
</div>
</div>
)
}