-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9fe137
commit 1a6954a
Showing
7 changed files
with
615 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { AppSidebar } from "@/components/app-sidebar" | ||
import { | ||
Breadcrumb, | ||
BreadcrumbItem, | ||
BreadcrumbLink, | ||
BreadcrumbList, | ||
BreadcrumbPage, | ||
BreadcrumbSeparator, | ||
} from "@/components/ui/breadcrumb" | ||
import { Separator } from "@/components/ui/separator" | ||
import { | ||
SidebarInset, | ||
SidebarProvider, | ||
SidebarTrigger, | ||
} from "@/components/ui/sidebar" | ||
|
||
export default function Page() { | ||
return ( | ||
<SidebarProvider> | ||
<AppSidebar /> | ||
<SidebarInset> | ||
<div className={'mx-auto w-[1000px]'}> | ||
<header | ||
className="flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12"> | ||
<div className="flex items-center gap-2 px-4"> | ||
{/*<SidebarTrigger className="-ml-1"/>*/} | ||
{/*<Separator orientation="vertical" className="mr-2 h-4"/>*/} | ||
<Breadcrumb> | ||
<BreadcrumbList> | ||
<BreadcrumbItem className="hidden md:block"> | ||
<BreadcrumbLink href="#"> | ||
Building Your Application | ||
</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbSeparator className="hidden md:block"/> | ||
<BreadcrumbItem> | ||
<BreadcrumbPage>Data Fetching</BreadcrumbPage> | ||
</BreadcrumbItem> | ||
</BreadcrumbList> | ||
</Breadcrumb> | ||
</div> | ||
</header> | ||
<div className="flex flex-1 flex-col gap-4 p-4 pt-0"> | ||
<div className="grid auto-rows-min gap-4 md:grid-cols-3"> | ||
<div className="aspect-video rounded-xl bg-muted/50"/> | ||
<div className="aspect-video rounded-xl bg-muted/50"/> | ||
<div className="aspect-video rounded-xl bg-muted/50"/> | ||
</div> | ||
<div className="min-h-[100vh] flex-1 rounded-xl bg-muted/50 md:min-h-min"/> | ||
</div> | ||
</div> | ||
</SidebarInset> | ||
</SidebarProvider> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import { | ||
AudioWaveform, | ||
BookOpen, | ||
Bot, | ||
Command, | ||
Frame, | ||
GalleryVerticalEnd, | ||
Map, | ||
PieChart, | ||
Settings2, | ||
SquareTerminal, | ||
} from "lucide-react" | ||
|
||
import { NavMain } from "@/components/nav-main" | ||
import { NavProjects } from "@/components/nav-projects" | ||
import { NavUser } from "@/components/nav-user" | ||
import { TeamSwitcher } from "@/components/team-switcher" | ||
import { | ||
Sidebar, | ||
SidebarContent, | ||
SidebarFooter, | ||
SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, | ||
SidebarRail, | ||
} from "@/components/ui/sidebar" | ||
|
||
// This is sample data. | ||
const data = { | ||
user: { | ||
name: "shadcn", | ||
email: "[email protected]", | ||
avatar: "/avatars/shadcn.jpg", | ||
}, | ||
teams: [ | ||
{ | ||
name: "Acme Inc", | ||
logo: GalleryVerticalEnd, | ||
plan: "Enterprise", | ||
}, | ||
{ | ||
name: "Acme Corp.", | ||
logo: AudioWaveform, | ||
plan: "Startup", | ||
}, | ||
{ | ||
name: "Evil Corp.", | ||
logo: Command, | ||
plan: "Free", | ||
}, | ||
], | ||
navMain: [ | ||
{ | ||
title: "Playground", | ||
url: "#", | ||
icon: SquareTerminal, | ||
isActive: true, | ||
items: [ | ||
{ | ||
title: "History", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Starred", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Settings", | ||
url: "#", | ||
}, | ||
], | ||
}, | ||
{ | ||
title: "Models", | ||
url: "#", | ||
icon: Bot, | ||
items: [ | ||
{ | ||
title: "Genesis", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Explorer", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Quantum", | ||
url: "#", | ||
}, | ||
], | ||
}, | ||
{ | ||
title: "Documentation", | ||
url: "#", | ||
icon: BookOpen, | ||
items: [ | ||
{ | ||
title: "Introduction", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Get Started", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Tutorials", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Changelog", | ||
url: "#", | ||
}, | ||
], | ||
}, | ||
{ | ||
title: "Settings", | ||
url: "#", | ||
icon: Settings2, | ||
items: [ | ||
{ | ||
title: "General", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Team", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Billing", | ||
url: "#", | ||
}, | ||
{ | ||
title: "Limits", | ||
url: "#", | ||
}, | ||
], | ||
}, | ||
], | ||
projects: [ | ||
{ | ||
name: "Design Engineering", | ||
url: "#", | ||
icon: Frame, | ||
}, | ||
{ | ||
name: "Sales & Marketing", | ||
url: "#", | ||
icon: PieChart, | ||
}, | ||
{ | ||
name: "Travel", | ||
url: "#", | ||
icon: Map, | ||
}, | ||
], | ||
} | ||
|
||
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) { | ||
return ( | ||
<Sidebar collapsible="icon" {...props}> | ||
<SidebarHeader> | ||
<SidebarMenu> | ||
<SidebarMenuItem> | ||
<SidebarMenuButton size="lg" asChild> | ||
<a href="#"> | ||
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground"> | ||
<Command className="size-4" /> | ||
</div> | ||
<div className="grid flex-1 text-left text-sm leading-tight"> | ||
<span className="truncate font-semibold">Acme Inc</span> | ||
<span className="truncate text-xs">Enterprise</span> | ||
</div> | ||
</a> | ||
</SidebarMenuButton> | ||
</SidebarMenuItem> | ||
</SidebarMenu> | ||
</SidebarHeader> | ||
<SidebarContent> | ||
<NavMain items={data.navMain} /> | ||
<NavProjects projects={data.projects} /> | ||
</SidebarContent> | ||
<SidebarFooter> | ||
<NavUser user={data.user} /> | ||
</SidebarFooter> | ||
<SidebarRail /> | ||
</Sidebar> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
"use client" | ||
|
||
import { ChevronRight, type LucideIcon } from "lucide-react" | ||
|
||
import { | ||
Collapsible, | ||
CollapsibleContent, | ||
CollapsibleTrigger, | ||
} from "@/components/ui/collapsible" | ||
import { | ||
SidebarGroup, | ||
SidebarGroupLabel, | ||
SidebarMenu, | ||
SidebarMenuButton, | ||
SidebarMenuItem, | ||
SidebarMenuSub, | ||
SidebarMenuSubButton, | ||
SidebarMenuSubItem, | ||
} from "@/components/ui/sidebar" | ||
|
||
export function NavMain({ | ||
items, | ||
}: { | ||
items: { | ||
title: string | ||
url: string | ||
icon?: LucideIcon | ||
isActive?: boolean | ||
items?: { | ||
title: string | ||
url: string | ||
}[] | ||
}[] | ||
}) { | ||
return ( | ||
<SidebarGroup> | ||
<SidebarGroupLabel>Platform</SidebarGroupLabel> | ||
<SidebarMenu> | ||
{items.map((item) => ( | ||
<Collapsible | ||
key={item.title} | ||
asChild | ||
defaultOpen={item.isActive} | ||
className="group/collapsible" | ||
> | ||
<SidebarMenuItem> | ||
<CollapsibleTrigger asChild> | ||
<SidebarMenuButton tooltip={item.title}> | ||
{item.icon && <item.icon />} | ||
<span>{item.title}</span> | ||
<ChevronRight className="ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" /> | ||
</SidebarMenuButton> | ||
</CollapsibleTrigger> | ||
<CollapsibleContent> | ||
<SidebarMenuSub> | ||
{item.items?.map((subItem) => ( | ||
<SidebarMenuSubItem key={subItem.title}> | ||
<SidebarMenuSubButton asChild> | ||
<a href={subItem.url}> | ||
<span>{subItem.title}</span> | ||
</a> | ||
</SidebarMenuSubButton> | ||
</SidebarMenuSubItem> | ||
))} | ||
</SidebarMenuSub> | ||
</CollapsibleContent> | ||
</SidebarMenuItem> | ||
</Collapsible> | ||
))} | ||
</SidebarMenu> | ||
</SidebarGroup> | ||
) | ||
} |
Oops, something went wrong.