"use client"; import { X, PanelRightClose } from "lucide-react"; import { useUI } from "@/lib/client/store"; import { Chat } from "@/components/chat/Chat"; import { useEffect, useRef } from "react"; export function AIPanel({ pathname }: { pathname: string }) { const ui = useUI(); const pageId = pathname.startsWith("/p/") ? pathname.slice(3).split(/[/?#]/)[0] : null; const drag = useRef<{ x: number; w: number } | null>(null); useEffect(() => { const mv = (e: MouseEvent) => { if (!drag.current) return; ui.set({ aiWidth: Math.min(720, Math.max(320, drag.current.w + (drag.current.x - e.clientX))) }); }; const up = () => (drag.current = null); window.addEventListener("mousemove", mv); window.addEventListener("mouseup", up); return () => { window.removeEventListener("mousemove", mv); window.removeEventListener("mouseup", up); }; }, [ui]); return ( <>
AI assistant
); }