"use client"; import { usePathname } from "next/navigation"; import { useTheme } from "next-themes"; import { useMemo } from "react"; import { FlickeringGrid } from "@/components/ui/flickering-grid"; import { ArtifactsProvider } from "@/components/workspace/artifacts"; export default function ChatLayout({ children, }: { children: React.ReactNode; }) { const pathname = usePathname(); const isNewThread = useMemo(() => { return pathname === "/workspace/chats/new"; }, [pathname]); const { theme, systemTheme } = useTheme(); const currentTheme = theme === "system" ? systemTheme : theme; return ( {isNewThread && ( <> )} {children} ); }