@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 88 lines 2.17 KB
Raw
1 import { T } from "gt-react";
2 import { RefreshIcon } from "~/components/ui/refresh-icon";
3
4 import type { ReactNode } from "react";
5
6 import { cn } from "../../lib/utils";
7 import { Button } from "../ui/button";
8
9 export function ClerkUserProfilePage({
10 action,
11 children,
12 className,
13 description,
14 title,
15 }: {
16 readonly action?: ReactNode;
17 readonly children: ReactNode;
18 readonly className?: string;
19 readonly description?: ReactNode;
20 readonly title: ReactNode;
21 }) {
22 return (
23 <div className={cn("w-full min-w-0 text-foreground", className)}>
24 <header className="flex flex-col gap-3 pb-4 sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:pr-8">
25 <div className="min-w-0">
26 <h2 className="text-base leading-6 font-semibold">{title}</h2>
27 {description ? (
28 <p className="mt-1 max-w-[34rem] text-xs leading-4.5 text-muted-foreground sm:min-h-9">
29 {description}
30 </p>
31 ) : null}
32 </div>
33 {action ? <div className="shrink-0">{action}</div> : null}
34 </header>
35
36 {children}
37 </div>
38 );
39 }
40
41 export function ClerkUserProfileRefreshButton({
42 className,
43 disabled = false,
44 isPending,
45 onClick,
46 }: {
47 readonly className?: string;
48 readonly disabled?: boolean;
49 readonly isPending: boolean;
50 readonly onClick: () => void;
51 }) {
52 return (
53 <Button
54 size="sm"
55 variant="outline"
56 className={className}
57 disabled={disabled || isPending}
58 onClick={onClick}
59 >
60 <RefreshIcon aria-hidden="true" size="sm" refreshing={isPending} />
61 <T>Refresh</T>
62 </Button>
63 );
64 }
65
66 export function ClerkUserProfileRow({
67 children,
68 className,
69 icon,
70 }: {
71 readonly children: ReactNode;
72 readonly className?: string;
73 readonly icon: ReactNode;
74 }) {
75 return (
76 <li className={cn("border-t py-4 first:border-t-0", className)}>
77 <div className="flex items-start gap-3">
78 <div
79 aria-hidden="true"
80 className="flex size-8 shrink-0 items-center justify-center rounded-lg border bg-muted/32 text-muted-foreground"
81 >
82 {icon}
83 </div>
84 <div className="min-w-0 flex-1">{children}</div>
85 </div>
86 </li>
87 );
88 }