import { Moon, Sun } from '@phosphor-icons/react';

export function ThemeToggle({ theme, onToggle, label }) {
  const isDark = theme === 'dark';
  return (
    <button type="button" className="theme-toggle" onClick={onToggle} aria-label={label} aria-pressed={isDark}>
      {isDark ? <Sun size={20} weight="regular" /> : <Moon size={20} weight="regular" />}
    </button>
  );
}
