added 2FA

This commit is contained in:
2024-04-26 22:16:21 +03:00
parent 53cadc289a
commit f17a002ac6
38 changed files with 1036 additions and 414 deletions

View File

@@ -1,4 +1,5 @@
'use client'
import { useChangeLocale, useCurrentLocale } from '@/locales/client'
import { LC, type loc } from '@/config/locales'
import { ChangeEvent } from 'react'
@@ -7,18 +8,14 @@ import styles from '@/styles/locale-switcher.module.scss'
export default function LocaleSwitcher () {
const changeLocale = useChangeLocale()
const locale = useCurrentLocale()
const selectHandler = (e: ChangeEvent<HTMLSelectElement>) => changeLocale(
e.target.value as loc)
const selectHandler = (e: ChangeEvent<HTMLSelectElement>) => changeLocale(e.target.value as loc)
return (
//@ts-ignore
<select onChange={selectHandler} defaultValue={locale}
className={styles['yo-locale-switcher']} aria-label="Switch language">
{LC.map(item => (
<option key={item.iso} value={item.code}>
{item.iso.toUpperCase()}
</option>
))}
</select>
)
return (//@ts-ignore
<select className={styles['yo-locale-switcher']} aria-label="Switch language"
defaultValue={locale} onChange={selectHandler}
>
{LC.map(item => (<option key={item.iso} value={item.code}>
{item.iso.toUpperCase()}
</option>))}
</select>)
}