mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 16:23:25 +01:00
16 lines
476 B
TypeScript
16 lines
476 B
TypeScript
import React from 'react';
|
|
import { useTheme } from '../hooks/useTheme';
|
|
import { toggleAppearance } from '../lib/theme/window';
|
|
import { IconButton } from './core/IconButton';
|
|
|
|
export function ToggleThemeButton() {
|
|
const { appearance, toggleAppearance } = useTheme();
|
|
return (
|
|
<IconButton
|
|
title={appearance === 'dark' ? 'Enable light mode' : 'Enable dark mode'}
|
|
icon={appearance === 'dark' ? 'moon' : 'sun'}
|
|
onClick={toggleAppearance}
|
|
/>
|
|
);
|
|
}
|