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

NoActiveThreadState.tsx

45 lines1.8 KB

1import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "./ui/empty";
2import { SidebarInset, SidebarTrigger } from "./ui/sidebar";
3import { isElectron } from "../env";
4import { cn } from "~/lib/utils";
5​
6export function NoActiveThreadState() {
7 return (
8 <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
9 <div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background">
10 <header
11 className={cn(
12 "border-b border-border px-3 sm:px-5",
13 isElectron
14 ? "drag-region flex h-[52px] items-center wco:h-[env(titlebar-area-height)]"
15 : "py-2 sm:py-3",
16 )}
17 >
18 {isElectron ? (
19 <span className="text-xs text-muted-foreground/50 wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]">
20 No active thread
21 </span>
22 ) : (
23 <div className="flex items-center gap-2">
24 <SidebarTrigger className="size-7 shrink-0 md:hidden" />
25 <span className="text-sm font-medium text-foreground md:text-muted-foreground/60">
26 No active thread
27 </span>
28 </div>
29 )}
30 </header>
31​
32 <Empty className="flex-1">
33 <div className="w-full max-w-lg rounded-3xl border border-border/55 bg-card/20 px-8 py-12 shadow-sm/5">
34 <EmptyHeader className="max-w-none">
35 <EmptyTitle className="text-foreground text-xl">Pick a thread to continue</EmptyTitle>
36 <EmptyDescription className="mt-2 text-sm text-muted-foreground/78">
37 Select an existing thread or create a new one to get started.
38 </EmptyDescription>
39 </EmptyHeader>
40 </div>
41 </Empty>
42 </div>
43 </SidebarInset>
44 );