import { t } from "@lingui/core/macro"; import { authClient } from "@kan/auth/client"; import Button from "~/components/Button"; import Input from "~/components/Input"; const CreateAPIKeyForm = ({ apiKey, refetchUser, }: { apiKey: | { id: number; prefix: string | null; key: string; } | null | undefined; refetchUser: () => void; }) => { const handleCreateAPIKey = async () => { await authClient.apiKey.create({ name: "Kan API Key", prefix: "kan_", }); refetchUser(); }; const handleRevokeAPIKey = async () => { if (!apiKey) return; await authClient.apiKey.delete({ keyId: apiKey.id.toString(), }); refetchUser(); }; return (