Working system

This commit is contained in:
2026-02-27 22:51:02 +01:00
parent 162e2b3d3f
commit 5895974af2
17 changed files with 356 additions and 332 deletions
+31 -22
View File
@@ -31,35 +31,44 @@ export default function Workspace() {
else Cookies.remove("workspace");
}, [currentWorkspace]);
return workspace ? (
<AppSidebar
workspace={workspace}
setRoute={setRoute}
updateEntity={updateEntity}
setWorkspace={setWorkspace}
>
if (!workspace) {
return (
<main
className="flex h-svh items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-slate-900 dark:to-slate-800"
onClick={() => {
const w = createDefaultWorkspace();
saveWorkspaceToLocalStorage(w);
setCurrentWorkspace(w.id);
}}
>
<div className="text-center space-y-6">
<h1 className="text-4xl font-bold">Welcome to Drift</h1>
<p className="text-lg text-muted-foreground">
Your personal productivity workspace
</p>
<Button size="lg" className="text-base">
Create a new workspace
</Button>
</div>
</main>
);
}
return (
<AppSidebar workspace={workspace} setRoute={setRoute}>
<SidebarTrigger className="w-full px-4">
<div className="px-4">
<header className="w-full border-b-2 pb-3 pt-2 hover:bg-accent/20 flex items-center text-foreground/90">
{workspace.name}
<ChevronRight className="h-5" />
{workspace.entities[route.entity || ""]?.name}
<header className="w-full border-b pb-3 pt-2 hover:bg-accent/20 flex items-center text-foreground/90 gap-2">
<span className="font-semibold">{workspace.name}</span>
<ChevronRight className="h-5 text-muted-foreground" />
<span className="text-muted-foreground">
{workspace.entities[route.entity || ""]?.name || "Select an item"}
</span>
</header>
</div>
</SidebarTrigger>
<Router workspace={workspace} route={route} updateEntity={updateEntity} />
</AppSidebar>
) : (
<main
className="flex h-svh items-center justify-center"
onClick={() => {
const w = createDefaultWorkspace();
saveWorkspaceToLocalStorage(w);
setCurrentWorkspace(w.id);
}}
>
<Button>Create a new workspace</Button>
</main>
);
}