'use client' import React, { useEffect, useState } from 'react' import { getCookie } from 'cookies-next' import { useTranslations } from 'next-intl' import classNames from 'classnames' import * as ToggleGroup from '@radix-ui/react-toggle-group' import styles from './index.module.scss' interface Props { currentElement: number sendValue: (value: number) => void } const ElementToggle = ({ currentElement, sendValue, ...props }: Props) => { // Localization const locale = (getCookie('NEXT_LOCALE') as string) || 'en' const t = useTranslations('common') // State: Component const [element, setElement] = useState(currentElement) // Methods: Handlers const handleElementChange = (value: string) => { const newElement = parseInt(value) setElement(newElement) sendValue(newElement) } // Methods: Rendering return ( {t('elements.null')} {t('elements.wind')} {t('elements.fire')} {t('elements.water')} {t('elements.earth')} {t('elements.dark')} {t('elements.light')} ) } export default ElementToggle