const Drawer = ({isOpen, onClose, children}) => {
    console.log(isOpen);
    return (
        <>
            {/* 遮罩层 */}
            {isOpen && <div className="drawer-overlay" onClick={onClose}/>}

            {/* 抽屉导航 */}
            <div className={`drawer ${isOpen ? 'drawer-open' : ''}`}>
                <div className="drawer-content">
                    <button className="drawer-close" onClick={onClose}>×</button>
                    {children}
                </div>
            </div>
        </>
    );
};

export default Drawer;
