mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-08 22:48:14 -05:00
161 lines
4.9 KiB
TypeScript
161 lines
4.9 KiB
TypeScript
import Providers from './providers'
|
|
import Link from 'next/link'
|
|
import { NavItem } from './components/nav-item'
|
|
import {
|
|
Home,
|
|
ShoppingCart,
|
|
Package,
|
|
Users2,
|
|
LineChart,
|
|
Settings,
|
|
PanelLeft,
|
|
Package2,
|
|
Plus,
|
|
} from 'lucide-react'
|
|
import {
|
|
Tooltip,
|
|
TooltipContent,
|
|
TooltipTrigger,
|
|
} from '@/components/ui/tooltip'
|
|
import { Button } from '@/components/ui/button'
|
|
import {
|
|
Sheet,
|
|
SheetContent,
|
|
SheetTrigger,
|
|
SheetTitle,
|
|
} from '@/components/ui/sheet'
|
|
import Image from 'next/image'
|
|
import { DesktopToolbar } from './components/desktop-toolbar'
|
|
import { WorkflowControlBar } from './components/workflow-control-bar'
|
|
import { AgentIcon } from '@/components/icons'
|
|
|
|
export default function WorkspaceLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode
|
|
}) {
|
|
return (
|
|
<Providers>
|
|
<main className="flex min-h-screen w-full flex-col bg-muted/40">
|
|
<div className="flex">
|
|
<DesktopNav />
|
|
<DesktopToolbar />
|
|
<div className="fixed top-0 left-[344px] right-0 z-30">
|
|
<WorkflowControlBar />
|
|
</div>
|
|
</div>
|
|
<div className="flex flex-col sm:gap-4 sm:pt-[56px] sm:pl-[344px]">
|
|
<header className="sticky top-0 z-30 flex h-14 items-center border-b bg-background sm:static sm:hidden">
|
|
<MobileNav />
|
|
</header>
|
|
<main className="grid flex-1 items-start gap-2 sm:py-0 md:gap-4 bg-muted/40">
|
|
{children}
|
|
</main>
|
|
</div>
|
|
</main>
|
|
</Providers>
|
|
)
|
|
}
|
|
|
|
function DesktopNav() {
|
|
return (
|
|
<aside className="fixed inset-y-0 left-0 z-10 hidden w-14 flex-col border-r bg-background sm:flex">
|
|
<nav className="flex flex-col items-center gap-4 px-2 sm:py-5">
|
|
<Link
|
|
href="#"
|
|
className="group flex h-8 w-8 items-center justify-center rounded-lg bg-[#7F2FFF]"
|
|
>
|
|
<AgentIcon className="text-white transition-all group-hover:scale-110 -translate-y-[0.5px] w-5 h-5" />
|
|
<span className="sr-only">Sim Studio</span>
|
|
</Link>
|
|
|
|
<NavItem href="#" label="Add Workflow">
|
|
<Plus className="h-5 w-5" />
|
|
</NavItem>
|
|
|
|
<NavItem href="#" label="Workflow 1">
|
|
<div className="h-4 w-4 rounded-full bg-[#3972F6]" />
|
|
</NavItem>
|
|
|
|
<NavItem href="#" label="Workflow 2">
|
|
<div className="h-4 w-4 rounded-full bg-[#F639DD]" />
|
|
</NavItem>
|
|
</nav>
|
|
<nav className="mt-auto flex flex-col items-center gap-4 px-2 sm:py-5">
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<Link
|
|
href="#"
|
|
className="flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground md:h-8 md:w-8"
|
|
>
|
|
<Settings className="h-5 w-5" />
|
|
<span className="sr-only">Settings</span>
|
|
</Link>
|
|
</TooltipTrigger>
|
|
<TooltipContent side="right">Settings</TooltipContent>
|
|
</Tooltip>
|
|
</nav>
|
|
</aside>
|
|
)
|
|
}
|
|
|
|
function MobileNav() {
|
|
return (
|
|
<Sheet>
|
|
<SheetTrigger asChild>
|
|
<Button size="icon" variant="outline" className="sm:hidden">
|
|
<PanelLeft className="h-5 w-5" />
|
|
<span className="sr-only">Toggle Menu</span>
|
|
</Button>
|
|
</SheetTrigger>
|
|
<SheetContent side="left" className="sm:max-w-xs">
|
|
<SheetTitle className="sr-only">Navigation Menu</SheetTitle>
|
|
<nav className="grid gap-6 text-lg font-medium">
|
|
<Link
|
|
href="#"
|
|
className="group flex h-10 w-10 shrink-0 items-center justify-center gap-2 rounded-full bg-primary text-lg font-semibold text-primary-foreground md:text-base"
|
|
>
|
|
<Package2 className="h-5 w-5 transition-all group-hover:scale-110" />
|
|
<span className="sr-only">Vercel</span>
|
|
</Link>
|
|
<Link
|
|
href="#"
|
|
className="flex items-center gap-4 px-2.5 text-muted-foreground hover:text-foreground"
|
|
>
|
|
<Home className="h-5 w-5" />
|
|
Dashboard
|
|
</Link>
|
|
<Link
|
|
href="#"
|
|
className="flex items-center gap-4 px-2.5 text-muted-foreground hover:text-foreground"
|
|
>
|
|
<ShoppingCart className="h-5 w-5" />
|
|
Orders
|
|
</Link>
|
|
<Link
|
|
href="#"
|
|
className="flex items-center gap-4 px-2.5 text-foreground"
|
|
>
|
|
<Package className="h-5 w-5" />
|
|
Products
|
|
</Link>
|
|
<Link
|
|
href="#"
|
|
className="flex items-center gap-4 px-2.5 text-muted-foreground hover:text-foreground"
|
|
>
|
|
<Users2 className="h-5 w-5" />
|
|
Customers
|
|
</Link>
|
|
<Link
|
|
href="#"
|
|
className="flex items-center gap-4 px-2.5 text-muted-foreground hover:text-foreground"
|
|
>
|
|
<LineChart className="h-5 w-5" />
|
|
Settings
|
|
</Link>
|
|
</nav>
|
|
</SheetContent>
|
|
</Sheet>
|
|
)
|
|
}
|