@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 73 lines 2.38 KB
Raw
1 import { msg, T, useGT, useMessages, Var } from "gt-react";
2
3 import { AndroidIcon, AppleIcon } from "../Icons";
4 import { Button } from "../ui/button";
5 import { Popover, PopoverPopup, PopoverTitle, PopoverTrigger } from "../ui/popover";
6 import { QRCodeSvg } from "../ui/qr-code";
7 import { SettingsRow } from "./settingsLayout";
8 import { useSearchableSetting } from "./settingsSearch";
9
10 const stores = [
11 {
12 label: msg("iPhone and iPad"),
13 store: "App Store",
14 url: "https://apps.apple.com/us/app/t3-code-remote-claude-more/id6787819824",
15 Icon: AppleIcon,
16 },
17 {
18 label: "Android",
19 store: "Google Play",
20 url: "https://play.google.com/store/apps/details?id=com.t3tools.t3code",
21 Icon: AndroidIcon,
22 },
23 ];
24
25 export function MobileAppSettingsRow() {
26 const searchableSetting = useSearchableSetting();
27 const gt = useGT();
28 const m = useMessages();
29 return (
30 <SettingsRow
31 {...searchableSetting("mobile-app")}
32 description={gt("Connect to your server from your phone or tablet.")}
33 control={
34 <div className="flex items-center gap-2">
35 {stores.map(({ label, store, url, Icon }) => (
36 <Popover key={store}>
37 <PopoverTrigger render={<Button size="sm" variant="outline" />}>
38 <Icon />
39 {m(label)}
40 </PopoverTrigger>
41 <PopoverPopup align="end">
42 <div className="flex flex-col items-center gap-3">
43 <PopoverTitle>{store}</PopoverTitle>
44 <p className="text-xs text-muted-foreground">
45 <T>Scan with your phone camera.</T>
46 </p>
47 <div className="rounded-lg bg-white p-1.5">
48 <QRCodeSvg
49 value={url}
50 size={128}
51 level="M"
52 marginSize={1}
53 title={gt("{store} link", { store })}
54 />
55 </div>
56 <Button
57 size="sm"
58 variant="outline"
59 render={<a href={url} target="_blank" rel="noreferrer noopener" />}
60 >
61 <T>
62 Open <Var>{store}</Var>
63 </T>
64 </Button>
65 </div>
66 </PopoverPopup>
67 </Popover>
68 ))}
69 </div>
70 }
71 />
72 );
73 }