import ButtonGroup from '@components/forms/ButtonGroup' import Select from '@components/forms/Select' // import dayjs from 'dayjs' import useLocalStorageState from 'hooks/useLocalStorageState' import { useTranslation } from 'next-i18next' import { useTheme } from 'next-themes' // import { useRouter } from 'next/router' // import { useCallback } from 'react' import { NOTIFICATION_POSITION_KEY, SIZE_INPUT_UI_KEY, TRADE_CHART_UI_KEY, } from 'utils/constants' const NOTIFICATION_POSITIONS = [ 'bottom-left', 'bottom-right', 'top-left', 'top-right', ] // const LANGS = [ // { locale: 'en', name: 'english', description: 'english' }, // { locale: 'ru', name: 'russian', description: 'russian' }, // { locale: 'es', name: 'spanish', description: 'spanish' }, // { // locale: 'zh_tw', // name: 'chinese-traditional', // description: 'traditional chinese', // }, // { locale: 'zh', name: 'chinese', description: 'simplified chinese' }, // ] export const THEMES = [ 'light', 'medium', 'dark', 'high-contrast', 'mango-classic', 'avocado', 'banana', 'blueberry', 'lychee', 'olive', ] const DisplaySettings = () => { const { t } = useTranslation(['common', 'settings']) const { theme, setTheme } = useTheme() // const [savedLanguage, setSavedLanguage] = useLocalStorageState('language', '') // const router = useRouter() // const { pathname, asPath, query } = router const [notificationPosition, setNotificationPosition] = useLocalStorageState( NOTIFICATION_POSITION_KEY, 'bottom-left' ) const [tradeFormUi, setTradeFormUi] = useLocalStorageState( SIZE_INPUT_UI_KEY, 'Slider' ) const [tradeChartUi, setTradeChartUi] = useLocalStorageState( TRADE_CHART_UI_KEY, 'Original' ) // const handleLangChange = useCallback( // (l: string) => { // setSavedLanguage(l) // router.push({ pathname, query }, asPath, { locale: l }) // dayjs.locale(l == 'zh_tw' ? 'zh-tw' : l) // }, // [router] // ) return ( <>

{t('settings:display')}

{t('settings:theme')}

{/*

{t('settings:language')}

handleLangChange(l)} values={LANGS.map((val) => val.locale)} names={LANGS.map((val) => t(`settings:${val.name}`))} />
*/}

{t('settings:notification-position')}

setNotificationPosition(p)} values={NOTIFICATION_POSITIONS} names={NOTIFICATION_POSITIONS.map((val) => t(`settings:${val}`))} />

{t('settings:swap-trade-size-selector')}

setTradeFormUi(v)} values={[t('settings:slider'), t('settings:buttons')]} />

{t('settings:swap-trade-size-selector')}

setTradeChartUi(v)} values={[t('settings:original'), t('settings:trading')]} />
) } export default DisplaySettings