"use client" import { cn } from "@lib/utils" import { dmSans125ClassName } from "@/lib/fonts" import { RaycastIcon } from "@/components/integration-icons" import { authClient } from "@lib/auth" import { useAuth } from "@lib/auth-context" import { generateId } from "@lib/generate-id" import { RAYCAST_EXTENSION_URL } from "@lib/constants" import { useMutation } from "@tanstack/react-query" import { Download, Key, Loader } from "lucide-react" import { useState } from "react" import { toast } from "sonner" import { RaycastSetupModal } from "./raycast-setup-modal" function PillButton({ children, onClick, disabled, }: { children: React.ReactNode onClick?: () => void disabled?: boolean }) { return ( ) } export function RaycastDetail() { const { org } = useAuth() const [showModal, setShowModal] = useState(false) const [apiKey, setApiKey] = useState("") const createKeyMutation = useMutation({ mutationFn: async () => { if (!org?.id) throw new Error("Organization ID is required") const res = await authClient.apiKey.create({ metadata: { organizationId: org.id, type: "raycast-extension" }, name: `raycast-${generateId().slice(0, 8)}`, prefix: `sm_${org.id}_`, }) if (res.error) throw new Error(res.error.message ?? "Failed to create API key") if (!res.data?.key) throw new Error("API key missing from response") return res.data.key }, onSuccess: (key) => { setApiKey(key) setShowModal(true) }, onError: (error) => { toast.error("Failed to create API key", { description: error instanceof Error ? error.message : "Unknown error", }) }, }) return ( <>
Raycast Extension
Add and search memories from Mac and Windows