import { Select } from 'antd';
import { useTranslation } from 'react-i18next';

const { Option } = Select;

const LanguageSwitch = () => {
    const { i18n } = useTranslation();

    const handleChange = (value: string) => {
        i18n.changeLanguage(value);
    };

    return (
        <Select value={i18n.language} onChange={handleChange} style={{ width: 120 }}>
            <Option value="fa-IR">فارسی</Option>
            <Option value="en-US">English</Option>
            <Option value="zh-CN">简体中文</Option>
        </Select>
    );
};

export default LanguageSwitch;
