import Link from 'next/link';

export default function Sidebar({ open, onClose }: { open: boolean; onClose: () => void }) {
  return (
    <aside
      className={
        `fixed inset-y-0 right-0 w-64 bg-background shadow-lg transform transition-transform duration-300 ` +
        (open ? 'translate-x-0' : 'translate-x-full')
      }
    >
      <button onClick={onClose} className="p-4 focus:outline-none text-primary">✕ 关闭</button>
      <nav className="flex flex-col p-6 gap-6 font-medium">
        <Link href="/features" legacyBehavior>
          <a onClick={onClose} className="hover:text-accent">特性</a>
        </Link>
        <Link href="/pricing" legacyBehavior>
          <a onClick={onClose} className="hover:text-accent">定价</a>
        </Link>
        <Link href="/contact" legacyBehavior>
          <a onClick={onClose} className="hover:text-accent">联系我们</a>
        </Link>
      </nav>
    </aside>
  );
}