import React from 'react'; import './ThemeSwitcher.css'; const MODES = [ { value: 'light', label: '日间' }, { value: 'dark', label: '夜间' }, { value: 'auto', label: '自动' } ]; const BRANDS = ['#2F54EB', '#1677FF', '#722ED1', '#13C2C2', '#FA541C', '#EB2F96']; export default function ThemeSwitcher({ mode = 'light', brand = '#2F54EB', onModeChange, onBrandChange }) { return (
{MODES.map((m) => (
(e.key === 'Enter' || e.key === ' ') && onModeChange && onModeChange(m.value)} onClick={() => onModeChange && onModeChange(m.value)} > {m.label}
))}
{BRANDS.map((c) => ( (e.key === 'Enter' || e.key === ' ') && onBrandChange && onBrandChange(c)} onClick={() => onBrandChange && onBrandChange(c)} /> ))}
品牌色:{brand}(应用于 Kole 品牌令牌实时预览)
); }