import React, { useState, useEffect } from 'react'; import { XIcon } from 'lucide-react'; interface InlineSlideInPanelProps { isOpen: boolean; onClose: () => void; title: string; children: React.ReactNode; width?: string; } export default function InlineSlideInPanel({ isOpen, onClose, title, children, width = '320px' }: InlineSlideInPanelProps) { const [mounted, setMounted] = useState(false); // Debug logging console.log("InlineSlideInPanel render:", { isOpen, mounted, title }); // Handle animation timing useEffect(() => { console.log("InlineSlideInPanel useEffect triggered. isOpen:", isOpen); if (isOpen) { console.log("InlineSlideInPanel setting mounted to true"); setMounted(true); } else { console.log("InlineSlideInPanel setting up timer to unmount"); const timer = setTimeout(() => { console.log("InlineSlideInPanel timer fired, setting mounted to false"); setMounted(false); }, 300); // Match transition duration return () => clearTimeout(timer); } }, [isOpen]); if (!mounted && !isOpen) { return null; } return (
{/* Header */}

{title}

{/* Content */}
{children}
); }