import React, { useState, useEffect } from 'react'; import { XIcon } from 'lucide-react'; interface SlideInPanelProps { isOpen: boolean; onClose: () => void; title: string; children: React.ReactNode; width?: string; } export default function SlideInPanel({ isOpen, onClose, title, children, width = '320px' }: SlideInPanelProps) { const [mounted, setMounted] = useState(false); // Handle animation timing useEffect(() => { if (isOpen) { setMounted(true); } else { const timer = setTimeout(() => { setMounted(false); }, 300); // Match transition duration return () => clearTimeout(timer); } }, [isOpen]); if (!mounted && !isOpen) { return null; } return ( <> {/* Backdrop overlay */}
{/* Slide-in panel */}