Buggy Code
This commit is contained in:
@@ -13,7 +13,7 @@ export default function RootLayout({
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<body>
|
<body>
|
||||||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
|
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
|
||||||
<main suppressHydrationWarning>{children}</main>
|
{children}
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import * as React from "react"
|
|
||||||
|
|
||||||
export default function RootLayout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<main suppressHydrationWarning>
|
|
||||||
{children}
|
|
||||||
</main>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,97 +1,16 @@
|
|||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
"use client"
|
||||||
|
|
||||||
export default function DashboardPage() {
|
export default function Dashboard() {
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6 p-4 sm:p-6 lg:p-8">
|
<div className="container mx-auto">
|
||||||
<h1 className="text-3xl font-semibold mb-6">Dashboard Overview</h1>
|
<h1 className="text-3xl font-semibold text-white mb-6">Dashboard</h1>
|
||||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
<Card>
|
{[...Array(6)].map((_, i) => (
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
<div key={i} className="bg-white rounded-lg shadow-md p-6">
|
||||||
<CardTitle className="text-sm font-medium">Total Revenue</CardTitle>
|
<h2 className="text-xl font-semibold mb-4">Card {i + 1}</h2>
|
||||||
<svg
|
<p className="text-gray-600">This is some placeholder content for Card {i + 1}.</p>
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
</div>
|
||||||
viewBox="0 0 24 24"
|
))}
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
strokeWidth="2"
|
|
||||||
className="h-4 w-4 text-muted-foreground"
|
|
||||||
>
|
|
||||||
<path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
|
|
||||||
</svg>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<div className="text-2xl font-bold">$45,231.89</div>
|
|
||||||
<p className="text-xs text-muted-foreground">+20.1% 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">Subscriptions</CardTitle>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
strokeWidth="2"
|
|
||||||
className="h-4 w-4 text-muted-foreground"
|
|
||||||
>
|
|
||||||
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
|
|
||||||
<circle cx="9" cy="7" r="4" />
|
|
||||||
<path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
|
|
||||||
</svg>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<div className="text-2xl font-bold">+2350</div>
|
|
||||||
<p className="text-xs text-muted-foreground">+180.1% 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">Sales</CardTitle>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
strokeWidth="2"
|
|
||||||
className="h-4 w-4 text-muted-foreground"
|
|
||||||
>
|
|
||||||
<rect width="20" height="14" x="2" y="5" rx="2" />
|
|
||||||
<path d="M2 10h20" />
|
|
||||||
</svg>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<div className="text-2xl font-bold">+12,234</div>
|
|
||||||
<p className="text-xs text-muted-foreground">+19% 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">Active Now</CardTitle>
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
strokeWidth="2"
|
|
||||||
className="h-4 w-4 text-muted-foreground"
|
|
||||||
>
|
|
||||||
<path d="M22 12h-4l-3 9L9 3l-3 9H2" />
|
|
||||||
</svg>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<div className="text-2xl font-bold">+573</div>
|
|
||||||
<p className="text-xs text-muted-foreground">+201 since last hour</p>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,19 +1,26 @@
|
|||||||
import { Sidebar } from "@/components/panel-ui/doctor/app-sidebar"
|
"use client"
|
||||||
import { Navbar } from "@/components/panel-ui/doctor/app-navbar"
|
|
||||||
|
|
||||||
export default function DashboardLayout({
|
import { useState } from "react"
|
||||||
|
import Sidebar from "@/components/panel-ui/doctor/app-sidebar"
|
||||||
|
import Navbar from "@/components/panel-ui/doctor/app-navbar"
|
||||||
|
import { SidebarProvider } from "@/components/ui/sidebar"
|
||||||
|
|
||||||
|
export default function RootLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
|
const [isSidebarOpen, setIsSidebarOpen] = useState(true)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-[250px_1fr] h-screen">
|
<SidebarProvider defaultOpen={isSidebarOpen} >
|
||||||
<Sidebar />
|
<Sidebar/>
|
||||||
<div className="flex-1 flex flex-col">
|
<div className="flex-1 flex flex-col overflow-hidden">
|
||||||
<Navbar />
|
<Navbar />
|
||||||
<main className="flex-1 overflow-x-hidden overflow-y-auto p-4">{children}</main>
|
<main className="flex-1 overflow-x-hidden overflow-y-auto bg-gray-200 p-6">
|
||||||
|
{children}
|
||||||
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</SidebarProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,39 +10,49 @@ import {
|
|||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "@/components/ui/dropdown-menu"
|
} from "@/components/ui/dropdown-menu"
|
||||||
|
|
||||||
|
import { Menu } from "lucide-react"
|
||||||
|
import { SidebarTrigger } from "@/components/ui/sidebar"
|
||||||
|
|
||||||
import { ModeToggle } from "@/components/theme-toggle"
|
import { ModeToggle } from "@/components/theme-toggle"
|
||||||
|
|
||||||
export function Navbar() {
|
export default function Navbar() {
|
||||||
return (
|
return (
|
||||||
<nav className="border-b border-gray-200 px-4 py-2.5 dark:bg-neutral-900 bg-neutral-100 dark:border-gray-700">
|
|
||||||
<div className="flex flex-wrap justify-between items-center">
|
<nav className="bg-white shadow-md">
|
||||||
<div className="flex items-center justify-start">
|
<div className="container mx-auto px-6 py-3">
|
||||||
<Button variant="ghost" className="text-xl font-semibold flex items-center">
|
<div className="flex items-center justify-between">
|
||||||
Dashboard
|
<div className="flex items-center">
|
||||||
</Button>
|
<SidebarTrigger className="text-gray-500 focus:outline-none focus:text-gray-600">
|
||||||
</div>
|
<Menu className="h-6 w-6" />
|
||||||
<div className="flex items-center lg:order-2">
|
</SidebarTrigger>
|
||||||
<Button variant="ghost" size="icon">
|
<span className="ml-4 text-xl font-semibold text-gray-800">My Dashboard</span>
|
||||||
<Bell className="h-5 w-5" />
|
</div>
|
||||||
</Button>
|
<div className="flex items-center">
|
||||||
<DropdownMenu>
|
<div className="flex items-center lg:order-2">
|
||||||
<DropdownMenuTrigger asChild>
|
|
||||||
<Button variant="ghost" size="icon">
|
<Button variant="ghost" size="icon">
|
||||||
<User className="h-5 w-5" />
|
<Bell className="h-5 w-5" />
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
<DropdownMenu>
|
||||||
<DropdownMenuContent align="end">
|
<DropdownMenuTrigger asChild>
|
||||||
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
<Button variant="ghost" size="icon">
|
||||||
<DropdownMenuSeparator />
|
<User className="h-5 w-5" />
|
||||||
<DropdownMenuItem>Profile</DropdownMenuItem>
|
</Button>
|
||||||
<DropdownMenuItem>Settings</DropdownMenuItem>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuItem>Sign out</DropdownMenuItem>
|
<DropdownMenuContent align="end">
|
||||||
</DropdownMenuContent>
|
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
||||||
</DropdownMenu>
|
<DropdownMenuSeparator />
|
||||||
<ModeToggle />
|
<DropdownMenuItem>Profile</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem>Settings</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem>Sign out</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
<ModeToggle />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,43 +13,41 @@ import {
|
|||||||
SidebarProvider,
|
SidebarProvider,
|
||||||
} from "@/components/ui/sidebar"
|
} from "@/components/ui/sidebar"
|
||||||
|
|
||||||
export function Sidebar() {
|
export default function Sidebar() {
|
||||||
return (
|
return (
|
||||||
<SidebarProvider>
|
<ShadcnSidebar>
|
||||||
<ShadcnSidebar>
|
<SidebarHeader>
|
||||||
<SidebarHeader>
|
<h2 className="text-xl font-bold p-4">Dashboard</h2>
|
||||||
<h2 className="text-xl font-bold p-4">Dashboard</h2>
|
</SidebarHeader>
|
||||||
</SidebarHeader>
|
<SidebarContent>
|
||||||
<SidebarContent>
|
<SidebarMenu>
|
||||||
<SidebarMenu>
|
<SidebarMenuItem>
|
||||||
<SidebarMenuItem>
|
<SidebarMenuButton asChild>
|
||||||
<SidebarMenuButton asChild>
|
<Link href="/dashboard">
|
||||||
<Link href="/dashboard">
|
<Home className="mr-2 h-4 w-4" />
|
||||||
<Home className="mr-2 h-4 w-4" />
|
<span>Home</span>
|
||||||
<span>Home</span>
|
</Link>
|
||||||
</Link>
|
</SidebarMenuButton>
|
||||||
</SidebarMenuButton>
|
</SidebarMenuItem>
|
||||||
</SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
<SidebarMenuItem>
|
<SidebarMenuButton asChild>
|
||||||
<SidebarMenuButton asChild>
|
<Link href="/dashboard/users">
|
||||||
<Link href="/dashboard/users">
|
<Users className="mr-2 h-4 w-4" />
|
||||||
<Users className="mr-2 h-4 w-4" />
|
<span>Users</span>
|
||||||
<span>Users</span>
|
</Link>
|
||||||
</Link>
|
</SidebarMenuButton>
|
||||||
</SidebarMenuButton>
|
</SidebarMenuItem>
|
||||||
</SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
<SidebarMenuItem>
|
<SidebarMenuButton asChild>
|
||||||
<SidebarMenuButton asChild>
|
<Link href="/dashboard/settings">
|
||||||
<Link href="/dashboard/settings">
|
<Settings className="mr-2 h-4 w-4" />
|
||||||
<Settings className="mr-2 h-4 w-4" />
|
<span>Settings</span>
|
||||||
<span>Settings</span>
|
</Link>
|
||||||
</Link>
|
</SidebarMenuButton>
|
||||||
</SidebarMenuButton>
|
</SidebarMenuItem>
|
||||||
</SidebarMenuItem>
|
</SidebarMenu>
|
||||||
</SidebarMenu>
|
</SidebarContent>
|
||||||
</SidebarContent>
|
</ShadcnSidebar>
|
||||||
</ShadcnSidebar>
|
|
||||||
</SidebarProvider>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user