mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
refactor: migrate community prompts from imperative hook to jotai atom
This commit is contained in:
parent
ccce47846b
commit
8727acb5ad
3 changed files with 10 additions and 49 deletions
|
|
@ -12,8 +12,9 @@ import { ScrollArea } from "@/components/ui/scroll-area";
|
|||
import { Switch } from "@/components/ui/switch";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { type CommunityPrompt, useCommunityPrompts } from "@/hooks/use-community-prompts";
|
||||
import { communityPromptsAtom } from "@/atoms/search-spaces/search-space-query.atoms";
|
||||
import { authenticatedFetch } from "@/lib/auth-utils";
|
||||
import { useAtomValue } from "jotai";
|
||||
|
||||
interface SetupPromptStepProps {
|
||||
searchSpaceId: number;
|
||||
|
|
@ -21,7 +22,9 @@ interface SetupPromptStepProps {
|
|||
}
|
||||
|
||||
export function SetupPromptStep({ searchSpaceId, onComplete }: SetupPromptStepProps) {
|
||||
const { prompts, loading: loadingPrompts } = useCommunityPrompts();
|
||||
const communityPromptsQuery = useAtomValue(communityPromptsAtom);
|
||||
const prompts = communityPromptsQuery.data || [];
|
||||
const loadingPrompts = communityPromptsQuery.isPending;
|
||||
const [enableCitations, setEnableCitations] = useState(true);
|
||||
const [customInstructions, setCustomInstructions] = useState("");
|
||||
const [saving, setSaving] = useState(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue