"use client"; import { useEffect, useState, type ReactNode } from "react"; import { createPortal } from "react-dom"; import { LayoutGrid, Plus } from "lucide-react"; import { Button } from "@/components/ui/button"; import type { XuluxStoredThread } from "../runtime/types"; import { XuluxHistoryMenu } from "./XuluxHistoryMenu"; function HeaderPortal({ children }: { children: ReactNode }) { const [container, setContainer] = useState(null); useEffect(() => { setContainer( document.querySelector("[data-sub-project-header-portal]"), ); }, []); if (!container) return null; return createPortal(children, container); } export function XuluxHeaderActions({ visible, showChatActions, onNewChat, onShowTemplates, onRestoreThread, }: { visible: boolean; showChatActions: boolean; onNewChat: () => void; onShowTemplates: () => void; onRestoreThread: (thread: XuluxStoredThread) => void; }) { if (!visible) return null; return ( {showChatActions && ( <> )} ); }