diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-05-18 20:34:57 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-05-18 20:34:57 +0000 |
| commit | 85929850dfd7b0a9a2269df7f739dffd108ab3bc (patch) | |
| tree | 88caebf58b756fcaf6ebf6d11eb2ab9fce2e03ce /apps/web/components | |
| parent | 2743d9e38ecfdbf757d4d2f97bcf09d601245b59 (diff) | |
| download | karakeep-85929850dfd7b0a9a2269df7f739dffd108ab3bc.tar.zst | |
feat: Disable the AI summary button if AI is not configured. Fixes #649
Diffstat (limited to 'apps/web/components')
| -rw-r--r-- | apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx b/apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx index 717c98a1..b5e89a01 100644 --- a/apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx +++ b/apps/web/components/dashboard/bookmarks/SummarizeBookmarkArea.tsx @@ -2,6 +2,7 @@ import React from "react"; import { ActionButton } from "@/components/ui/action-button"; import LoadingSpinner from "@/components/ui/spinner"; import { toast } from "@/components/ui/use-toast"; +import { useClientConfig } from "@/lib/clientConfig"; import { useTranslation } from "@/lib/i18n/client"; import { cn } from "@/lib/utils"; import { ChevronUp, RefreshCw, Sparkles, Trash2 } from "lucide-react"; @@ -110,12 +111,15 @@ export default function SummarizeBookmarkArea({ }, }); + const clientConfig = useClientConfig(); if (bookmark.content.type !== BookmarkTypes.LINK) { return null; } if (bookmark.summary) { return <AISummary bookmarkId={bookmark.id} summary={bookmark.summary} />; + } else if (!clientConfig.inference.isConfigured) { + return null; } else { return ( <div className="flex w-full items-center gap-4"> |
