import { Moon, Sun } from "lucide-react";

export default function ThemeSwitch({ theme, setTheme }) {
  const dark = theme === "dark";

  return (
    <button className="icon-btn" onClick={() => setTheme(dark ? "light" : "dark")} aria-label="切换主题">
      {dark ? <Moon size={16} strokeWidth={2.6} /> : <Sun size={16} strokeWidth={2.6} />}
    </button>
  );
}
