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