The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { workspaceAreaProps } from "../lib/workspaceFocus"; |
| 2 | import { T, useGT } from "gt-react"; |
| 3 | import { MessageSquareDashedIcon, PlusIcon } from "lucide-react"; |
| 4 | |
| 5 | import { openCommandPalette } from "../commandPaletteBus"; |
| 6 | import { isElectron } from "../env"; |
| 7 | import { useScratchProject } from "../hooks/useScratchProject"; |
| 8 | import { usePrimaryEnvironmentId } from "../state/environments"; |
| 9 | import { Button } from "./ui/button"; |
| 10 | import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "./ui/empty"; |
| 11 | import { SidebarInset } from "./ui/sidebar"; |
| 12 | import { WorkspacePageHeader } from "./WorkspacePageHeader"; |
| 13 | |
| 14 | export function NoProjectsHero() { |
| 15 | const gt = useGT(); |
| 16 | const contentArea = workspaceAreaProps("home", 1, gt("Home")); |
| 17 | const primaryEnvironmentId = usePrimaryEnvironmentId(); |
| 18 | const { scratchEnvironmentId, startScratchThread } = useScratchProject(); |
| 19 | const scratchTargetEnvironmentId = scratchEnvironmentId(primaryEnvironmentId); |
| 20 | |
| 21 | return ( |
| 22 | <SidebarInset |
| 23 | {...contentArea} |
| 24 | role="main" |
| 25 | className="h-dvh min-h-0 overflow-hidden overscroll-y-none" |
| 26 | > |
| 27 | <div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background"> |
| 28 | {/* The desktop window only moves where CSS opts in, so keep a titlebar strip. */} |
| 29 | {isElectron ? <WorkspacePageHeader electron /> : null} |
| 30 | <Empty size="hero" className="flex-1"> |
| 31 | <div className="w-full max-w-lg px-8 py-12"> |
| 32 | <EmptyHeader className="max-w-none"> |
| 33 | <EmptyTitle> |
| 34 | <T>What should we work on?</T> |
| 35 | </EmptyTitle> |
| 36 | <EmptyDescription> |
| 37 | {scratchTargetEnvironmentId === null |
| 38 | ? gt("Add a project to start your first thread.") |
| 39 | : gt("Add a project, or start without one.")} |
| 40 | </EmptyDescription> |
| 41 | <div className="mt-6 flex justify-center gap-2"> |
| 42 | <Button size="sm" onClick={() => openCommandPalette({ open: "add-project" })}> |
| 43 | <PlusIcon className="size-4" /> |
| 44 | <T>Add project</T> |
| 45 | </Button> |
| 46 | {scratchTargetEnvironmentId === null ? null : ( |
| 47 | <Button |
| 48 | size="sm" |
| 49 | variant="outline" |
| 50 | onClick={() => void startScratchThread(scratchTargetEnvironmentId)} |
| 51 | > |
| 52 | <MessageSquareDashedIcon className="size-4" /> |
| 53 | <T>Start without a project</T> |
| 54 | </Button> |
| 55 | )} |
| 56 | </div> |
| 57 | </EmptyHeader> |
| 58 | </div> |
| 59 | </Empty> |
| 60 | </div> |
| 61 | </SidebarInset> |
| 62 | ); |
| 63 | } |