import { Box, Flex, Text, Menu, Button, HStack, IconButton, Tooltip, Portal, } from '@chakra-ui/react' import { FiSun, FiMoon, FiChevronDown } from 'react-icons/fi' import { useApp } from '../../stores/AppContext' import { FACTION_KEYS, getFactionName } from '../../themes' import type { FactionKey } from '../../themes/palettes' export default function ThemeSwitcher() { const { state, dispatch } = useApp() const handleFactionChange = (key: FactionKey) => { dispatch({ type: 'SET_FACTION', payload: key }) } const toggleColorMode = () => { dispatch({ type: 'SET_COLOR_MODE', payload: state.colorMode === 'day' ? 'night' : 'day', }) } return ( {state.colorMode === 'day' ? : } {state.colorMode === 'day' ? 'Switch to Night' : 'Switch to Day'} {FACTION_KEYS.map((key) => ( handleFactionChange(key)} bg={state.faction === key ? 'primary.subtle' : 'transparent'} color={state.faction === key ? 'primary.DEFAULT' : 'fg'} fontWeight={state.faction === key ? 'semibold' : 'normal'} _hover={{ bg: 'bg.subtle' }} cursor="pointer" py={2} > {getFactionName(key)} ))} ) }