| 1 | import type { ComponentProps } from "react"; |
| 2 | import { ExternalLinkIcon } from "lucide-react"; |
| 3 | import { CHATGPT_USAGE_URL } from "@t3tools/shared/usageLimits"; |
| 4 | import { ensureLocalApi } from "../../localApi"; |
| 5 | import { Button } from "../ui/button"; |
| 6 | |
| 7 | export 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 | } |