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

ChatGptUsageButton.tsx

20 lines656 Bytes

1import { T } from "gt-react";
2import type { ComponentProps } from "react";
3import { ExternalLinkIcon } from "lucide-react";
4import { CHATGPT_USAGE_URL } from "@t3tools/shared/usageLimits";
5import { ensureLocalApi } from "../../localApi";
6import { Button } from "../ui/button";
7​
8export function ChatGptUsageButton(props: Omit<ComponentProps<typeof Button>, "onClick">) {
9 return (
10 <Button
11 variant="ghost-muted"
12 size="sm"
13 {...props}
14 onClick={() => void ensureLocalApi().shell.openExternal(CHATGPT_USAGE_URL)}
15 >
16 <T>Manage usage</T>
17 <ExternalLinkIcon className="size-3.5" aria-hidden="true" />
18 </Button>
19 );