mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-04 05:12:38 +02:00
remove searchSpacesAtom from quick-ask, forward params via dashboard
This commit is contained in:
parent
59e0579cc0
commit
8d60fc7279
2 changed files with 9 additions and 13 deletions
|
|
@ -1,6 +1,5 @@
|
|||
"use client";
|
||||
|
||||
import { useAtomValue } from "jotai";
|
||||
import {
|
||||
BookOpen,
|
||||
Check,
|
||||
|
|
@ -13,7 +12,6 @@ import {
|
|||
Search,
|
||||
} from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { searchSpacesAtom } from "@/atoms/search-spaces/search-space-query.atoms";
|
||||
import { DEFAULT_ACTIONS } from "./actions";
|
||||
|
||||
const ICONS: Record<string, React.ReactNode> = {
|
||||
|
|
@ -28,7 +26,6 @@ const ICONS: Record<string, React.ReactNode> = {
|
|||
};
|
||||
|
||||
export default function QuickAskPage() {
|
||||
const { data: searchSpaces = [], isLoading } = useAtomValue(searchSpacesAtom);
|
||||
const [clipboardText, setClipboardText] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -38,10 +35,8 @@ export default function QuickAskPage() {
|
|||
}, []);
|
||||
|
||||
const navigateToChat = (prompt: string, mode: string) => {
|
||||
if (!searchSpaces.length || !clipboardText) return;
|
||||
const spaceId = searchSpaces[0].id;
|
||||
const encoded = encodeURIComponent(prompt);
|
||||
window.location.href = `/dashboard/${spaceId}/new-chat?quickAskPrompt=${encoded}&quickAskMode=${mode}`;
|
||||
window.location.href = `/dashboard?quickAskPrompt=${encoded}&quickAskMode=${mode}`;
|
||||
};
|
||||
|
||||
const handleAction = (actionId: string) => {
|
||||
|
|
@ -55,15 +50,13 @@ export default function QuickAskPage() {
|
|||
const exploreActions = DEFAULT_ACTIONS.filter((a) => a.group === "explore");
|
||||
const knowledgeActions = DEFAULT_ACTIONS.filter((a) => a.group === "knowledge");
|
||||
|
||||
const ready = !isLoading && clipboardText;
|
||||
|
||||
return (
|
||||
<div className="flex h-screen flex-col bg-background">
|
||||
<div className="flex-1 overflow-y-auto">
|
||||
{!ready && (
|
||||
{!clipboardText && (
|
||||
<div className="p-4 text-center text-sm text-muted-foreground">Loading...</div>
|
||||
)}
|
||||
{ready && (
|
||||
{clipboardText && (
|
||||
<div className="py-1">
|
||||
<div className="px-3 py-1.5 text-xs font-medium text-muted-foreground">Transform</div>
|
||||
{transformActions.map((action) => (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue