"use client"; import { usePathname } from "next/navigation"; import { useEffect, useState } from "react"; import { Assistant } from "@/lib/api/assistants/types"; import { useAssistants } from "@/lib/api/assistants/useAssistants"; import PageHeader from "@/lib/components/PageHeader/PageHeader"; import { BrainCard } from "@/lib/components/ui/BrainCard/BrainCard"; import { MessageInfoBox } from "@/lib/components/ui/MessageInfoBox/MessageInfoBox"; import { useSupabase } from "@/lib/context/SupabaseProvider"; import { redirectToLogin } from "@/lib/router/redirectToLogin"; import { AssistantModal } from "./AssistantModal/AssistantModal"; import styles from "./page.module.scss"; const Search = (): JSX.Element => { const pathname = usePathname(); const { session } = useSupabase(); const [assistants, setAssistants] = useState([]); const [assistantModalOpened, setAssistantModalOpened] = useState(false); const [currentAssistant, setCurrentAssistant] = useState( null ); const { getAssistants } = useAssistants(); useEffect(() => { if (session === null) { redirectToLogin(); } void (async () => { try { const res = await getAssistants(); if (res) { setAssistants(res); } } catch (error) { console.error(error); } })(); }, [pathname, session]); return ( <>
A Quivr Assistant is an AI agent that apply specific processes to an input in order to generate a usable output. For now, you can try the summary assistant, that summarizes a document and send the result by email or upload it in one of your brains. But don't worry! Other assistants are cooking!
Feature still in Beta. Please provide feedbacks on the chat below!
{assistants.map((assistant) => { return ( { setAssistantModalOpened(true); setCurrentAssistant(assistant); }} key={assistant.name} cardKey={assistant.name} /> ); })}
{currentAssistant && ( )} ); }; export default Search;