import type { ReactNode } from "react"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { toast } from "sonner"; export function ToolCard({ title, children }: { title: string; children: ReactNode }) { return {title}{children}; } export function QueryError({ error }: { error: unknown }) { return error ?

Couldn't load this tool. Check your connection and try again.

: null; } export function useToolAction() { const client = useQueryClient(); return useMutation({ mutationFn: (action: () => Promise) => action(), onSuccess: () => { void client.invalidateQueries(); toast.success("Saved"); }, onError: (error: Error) => toast.error(error.message || "Couldn't save. Please retry."), }); }