import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Input, InputNumber, Select, Switch, Tabs } from 'antd'; import { BellOutlined, SettingOutlined } from '@ant-design/icons'; import { LanguageManager } from '@/utils'; import type { AllSetting } from '@/models/setting'; import { SettingListItem } from '@/components/ui'; import { useMediaQuery } from '@/hooks/useMediaQuery'; import { catTabLabel } from './catTabLabel'; interface TelegramTabProps { allSetting: AllSetting; updateSetting: (patch: Partial) => void; } export default function TelegramTab({ allSetting, updateSetting }: TelegramTabProps) { const { t } = useTranslation(); const { isMobile } = useMediaQuery(); const langOptions = useMemo( () => LanguageManager.supportedLanguages.map((l: { value: string; name: string; icon: string }) => ({ value: l.value, label: ( <> {l.icon}   {l.name} ), })), [], ); return ( , t('pages.settings.panelSettings'), isMobile), children: ( <> updateSetting({ tgBotEnable: v })} /> updateSetting({ tgBotToken: e.target.value })} /> updateSetting({ tgBotChatId: e.target.value })} /> updateSetting({ tgBotAPIServer: e.target.value })} /> ), }, { key: '2', label: catTabLabel(, t('pages.settings.notifications'), isMobile), children: ( <> updateSetting({ tgRunTime: e.target.value })} /> updateSetting({ tgBotBackup: v })} /> updateSetting({ tgBotLoginNotify: v })} /> updateSetting({ tgCpu: Number(v) || 0 })} /> ), }, ]} /> ); }