@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
tsx 54 lines 1.81 KB
Raw
1 import { useGT } from "gt-react";
2 import type { ReactNode } from "react";
3 import { Smartphone } from "lucide-react";
4
5 import { Spinner } from "~/components/ui/spinner";
6
7 export function DeviceLoadingView(props: {
8 readonly name: string;
9 readonly description?: string;
10 readonly stage: "opening" | "stream";
11 readonly message: string;
12 readonly error?: boolean;
13 readonly children?: ReactNode;
14 }) {
15 const gt = useGT();
16 return (
17 <div
18 role={props.error ? "alert" : "status"}
19 className="flex size-full items-center justify-center bg-background px-6 py-10"
20 >
21 <div className="flex max-w-sm flex-col items-center gap-3 text-center">
22 <div className="grid size-12 place-items-center rounded-xl border bg-muted/30">
23 <Smartphone className="size-6 text-muted-foreground" />
24 </div>
25 <div className="space-y-1">
26 <p className="text-sm font-medium">{props.name}</p>
27 {props.description ? (
28 <p className="text-xs text-muted-foreground">{props.description}</p>
29 ) : null}
30 </div>
31 <div className="flex items-center gap-2 text-xs text-muted-foreground">
32 {!props.error ? <Spinner size="xs" /> : null}
33 <span>{props.message}</span>
34 </div>
35 {props.children}
36 {!props.error ? (
37 <div
38 className="flex w-24 gap-1"
39 aria-label={
40 props.stage === "opening"
41 ? gt("Step 1 of 2: open device")
42 : gt("Step 2 of 2: connect video")
43 }
44 >
45 <span className="h-1 flex-1 rounded-full bg-foreground/60" />
46 <span
47 className={`h-1 flex-1 rounded-full ${props.stage === "stream" ? "bg-foreground/60" : "bg-muted"}`}
48 />
49 </div>
50 ) : null}
51 </div>
52 </div>
53 );
54 }