'use client' import { useState, useEffect } from 'react' import { Menu, X } from 'lucide-react' import { Sidebar } from '../navigation/Sidebar' import { cn } from '@/lib/utils' interface ResponsiveLayoutProps { children: React.ReactNode role?: 'creator' | 'agency' | 'brand' className?: string } export function ResponsiveLayout({ children, role = 'creator', className = '', }: ResponsiveLayoutProps) { const [isMobile, setIsMobile] = useState(false) const [sidebarOpen, setSidebarOpen] = useState(false) useEffect(() => { const checkMobile = () => { const mobile = window.innerWidth < 1024 setIsMobile(mobile) // 大屏幕自动关闭抽屉 if (!mobile) { setSidebarOpen(false) } } checkMobile() window.addEventListener('resize', checkMobile) return () => window.removeEventListener('resize', checkMobile) }, []) // 点击遮罩关闭侧边栏 const closeSidebar = () => setSidebarOpen(false) return (