Buggy Code

This commit is contained in:
Sir Blob
2025-01-25 07:53:43 -05:00
parent 6536c0b398
commit 5aec47c617
6 changed files with 98 additions and 179 deletions

View File

@@ -13,7 +13,7 @@ export default function RootLayout({
<html lang="en">
<body>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
<main suppressHydrationWarning>{children}</main>
{children}
</ThemeProvider>
</body>
</html>

View File

@@ -1,15 +0,0 @@
"use client"
import * as React from "react"
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<main suppressHydrationWarning>
{children}
</main>
)
}

View File

@@ -1,97 +1,16 @@
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
"use client"
export default function DashboardPage() {
export default function Dashboard() {
return (
<div className="space-y-6 p-4 sm:p-6 lg:p-8">
<h1 className="text-3xl font-semibold mb-6">Dashboard Overview</h1>
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Total Revenue</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="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 className="container mx-auto">
<h1 className="text-3xl font-semibold text-white mb-6">Dashboard</h1>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{[...Array(6)].map((_, i) => (
<div key={i} className="bg-white rounded-lg shadow-md p-6">
<h2 className="text-xl font-semibold mb-4">Card {i + 1}</h2>
<p className="text-gray-600">This is some placeholder content for Card {i + 1}.</p>
</div>
))}
</div>
</div>
)

View File

@@ -1,19 +1,26 @@
import { Sidebar } from "@/components/panel-ui/doctor/app-sidebar"
import { Navbar } from "@/components/panel-ui/doctor/app-navbar"
"use client"
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: React.ReactNode
}) {
const [isSidebarOpen, setIsSidebarOpen] = useState(true)
return (
<div className="grid grid-cols-[250px_1fr] h-screen">
<Sidebar />
<div className="flex-1 flex flex-col">
<SidebarProvider defaultOpen={isSidebarOpen} >
<Sidebar/>
<div className="flex-1 flex flex-col overflow-hidden">
<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>
</SidebarProvider>
)
}

View File

@@ -10,39 +10,49 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
import { Menu } from "lucide-react"
import { SidebarTrigger } from "@/components/ui/sidebar"
import { ModeToggle } from "@/components/theme-toggle"
export function Navbar() {
export default function Navbar() {
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">
<div className="flex items-center justify-start">
<Button variant="ghost" className="text-xl font-semibold flex items-center">
Dashboard
</Button>
</div>
<div className="flex items-center lg:order-2">
<Button variant="ghost" size="icon">
<Bell className="h-5 w-5" />
</Button>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<nav className="bg-white shadow-md">
<div className="container mx-auto px-6 py-3">
<div className="flex items-center justify-between">
<div className="flex items-center">
<SidebarTrigger className="text-gray-500 focus:outline-none focus:text-gray-600">
<Menu className="h-6 w-6" />
</SidebarTrigger>
<span className="ml-4 text-xl font-semibold text-gray-800">My Dashboard</span>
</div>
<div className="flex items-center">
<div className="flex items-center lg:order-2">
<Button variant="ghost" size="icon">
<User className="h-5 w-5" />
<Bell className="h-5 w-5" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuLabel>My Account</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem>Profile</DropdownMenuItem>
<DropdownMenuItem>Settings</DropdownMenuItem>
<DropdownMenuItem>Sign out</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<ModeToggle />
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon">
<User className="h-5 w-5" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuLabel>My Account</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem>Profile</DropdownMenuItem>
<DropdownMenuItem>Settings</DropdownMenuItem>
<DropdownMenuItem>Sign out</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<ModeToggle />
</div>
</div>
</div>
</div>
</nav>
)
}

View File

@@ -13,43 +13,41 @@ import {
SidebarProvider,
} from "@/components/ui/sidebar"
export function Sidebar() {
export default function Sidebar() {
return (
<SidebarProvider>
<ShadcnSidebar>
<SidebarHeader>
<h2 className="text-xl font-bold p-4">Dashboard</h2>
</SidebarHeader>
<SidebarContent>
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton asChild>
<Link href="/dashboard">
<Home className="mr-2 h-4 w-4" />
<span>Home</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton asChild>
<Link href="/dashboard/users">
<Users className="mr-2 h-4 w-4" />
<span>Users</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton asChild>
<Link href="/dashboard/settings">
<Settings className="mr-2 h-4 w-4" />
<span>Settings</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarContent>
</ShadcnSidebar>
</SidebarProvider>
<ShadcnSidebar>
<SidebarHeader>
<h2 className="text-xl font-bold p-4">Dashboard</h2>
</SidebarHeader>
<SidebarContent>
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton asChild>
<Link href="/dashboard">
<Home className="mr-2 h-4 w-4" />
<span>Home</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton asChild>
<Link href="/dashboard/users">
<Users className="mr-2 h-4 w-4" />
<span>Users</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton asChild>
<Link href="/dashboard/settings">
<Settings className="mr-2 h-4 w-4" />
<span>Settings</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarContent>
</ShadcnSidebar>
)
}