File size: 820 Bytes
e83084c
 
 
 
 
 
 
 
 
 
 
 
 
 
0d05012
e83084c
0d05012
e83084c
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use client';

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

export function ThemeToggle({ className = '' }: { className?: string }) {
  const { theme, toggleTheme } = useTheme();
  const isDark = theme === 'dark';

  return (
    <button
      onClick={toggleTheme}
      aria-label={isDark ? 'Switch to light theme' : 'Switch to dark theme'}
      title={isDark ? 'Switch to light theme' : 'Switch to dark theme'}
      className={`flex items-center justify-center w-11 h-11 rounded-full border border-glass-border bg-surface-1/70 text-text-secondary hover:text-accent-cyan hover:border-accent-cyan/40 transition-colors cursor-pointer ${className}`}
    >
      {isDark ? <Sun size={17} weight="regular" /> : <Moon size={17} weight="regular" />}
    </button>
  );
}