"use client"; import { usePathname } from "next/navigation"; import { useEffect } from "react"; import { QuivrLogo } from "@/lib/assets/QuivrLogo"; import { AddBrainModal } from "@/lib/components/AddBrainModal"; import { SearchBar } from "@/lib/components/ui/SearchBar/SearchBar"; import { useMenuContext } from "@/lib/context/MenuProvider/hooks/useMenuContext"; import { useSupabase } from "@/lib/context/SupabaseProvider"; import { redirectToLogin } from "@/lib/router/redirectToLogin"; import styles from "./page.module.scss"; import { useChatsList } from "../chat/[chatId]/hooks/useChatsList"; const Search = (): JSX.Element => { const { setIsOpened } = useMenuContext(); const pathname = usePathname(); const { session } = useSupabase(); useEffect(() => { if (session === null) { redirectToLogin(); } setIsOpened(false); }, [pathname, session, setIsOpened]); useChatsList(); return (