Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

NoProjectsHero.tsx

36 lines1.5 KB

1import { PlusIcon } from "lucide-react";
2import { useCallback } from "react";
3​
4import { openCommandPalette } from "../commandPaletteBus";
5import { isElectron } from "../env";
6import { Button } from "./ui/button";
7import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "./ui/empty";
8import { SidebarInset } from "./ui/sidebar";
9import { WorkspacePageHeader } from "./WorkspacePageHeader";
10​
11export function NoProjectsHero() {
12 const openAddProject = useCallback(() => openCommandPalette({ open: "add-project" }), []);
13​
14 return (
15 <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none">
16 <div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background">
17 {/* The desktop window only moves where CSS opts in, so keep a titlebar strip. */}
18 {isElectron ? <WorkspacePageHeader electron /> : null}
19 <Empty size="hero" className="flex-1">
20 <div className="w-full max-w-lg px-8 py-12">
21 <EmptyHeader className="max-w-none">
22 <EmptyTitle>What should we work on?</EmptyTitle>
23 <EmptyDescription>Add a project to start your first thread.</EmptyDescription>
24 <div className="mt-6 flex justify-center">
25 <Button size="sm" onClick={openAddProject}>
26 <PlusIcon className="size-4" />
27 Add project
28 </Button>
29 </div>
30 </EmptyHeader>
31 </div>
32 </Empty>
33 </div>
34 </SidebarInset>
35 );