690605:2335 ADR-035-135 #1
CI / CD Pipeline / build (push) Successful in 4m54s
CI / CD Pipeline / deploy (push) Successful in 6m19s

This commit is contained in:
2026-06-05 23:35:22 +07:00
parent 285c007dff
commit 26cc71ce60
47 changed files with 2912 additions and 1767 deletions
+5 -27
View File
@@ -1,19 +1,11 @@
'use client';
import { Bot } from 'lucide-react';
import { useRagQuery } from '../../../hooks/use-rag';
import { RagChatWidget } from '../../../components/ai/RagChatWidget';
import { useProjectStore } from '../../../lib/stores/project-store';
import { RagSearchBar } from '../../../components/rag/rag-search-bar';
import { RagResultCard } from '../../../components/rag/rag-result-card';
export default function RagPage() {
const { selectedProjectId } = useProjectStore();
const { mutate, data, isPending, error, isIdle } = useRagQuery();
const handleSearch = (question: string) => {
if (!selectedProjectId) return;
mutate({ question, projectPublicId: selectedProjectId });
};
return (
<div className="container mx-auto max-w-3xl py-8 space-y-6">
@@ -28,25 +20,11 @@ export default function RagPage() {
</div>
)}
<RagSearchBar onSearch={handleSearch} isLoading={isPending} />
{isPending && (
<div className="rounded-lg border bg-card p-6 text-center text-sm text-muted-foreground animate-pulse">
...
</div>
)}
{error && (
<div className="rounded-md border border-destructive/50 bg-destructive/10 px-4 py-3 text-sm text-destructive">
: {error.message}
</div>
)}
{data && !isPending && <RagResultCard result={data} />}
{isIdle && !error && (
{selectedProjectId ? (
<RagChatWidget projectPublicId={selectedProjectId} />
) : (
<p className="text-center text-sm text-muted-foreground pt-4">
RAG pipeline
</p>
)}
</div>