import { Input, InputNumber, Switch, Tabs } from 'antd'; import { BranchesOutlined, CompassOutlined, IdcardOutlined, InfoCircleOutlined, NodeIndexOutlined, SafetyCertificateOutlined, SettingOutlined } from '@ant-design/icons'; import { useTranslation } from 'react-i18next'; import type { AllSetting } from '@/models/setting'; import { SettingListItem } from '@/components/ui'; import { RemarkTemplateField } from '@/components/form'; import { useMediaQuery } from '@/hooks/useMediaQuery'; import { catTabLabel } from './catTabLabel'; import { sanitizePath, normalizePath } from './uriPath'; interface SubscriptionGeneralTabProps { allSetting: AllSetting; updateSetting: (patch: Partial) => void; } export default function SubscriptionGeneralTab({ allSetting, updateSetting }: SubscriptionGeneralTabProps) { const { t } = useTranslation(); const { isMobile } = useMediaQuery(); return ( , t('pages.settings.panelSettings'), isMobile), children: ( <> updateSetting({ subEnable: v })} /> updateSetting({ subJsonEnable: v })} /> updateSetting({ subClashEnable: v })} /> updateSetting({ subListen: e.target.value })} /> updateSetting({ subDomain: e.target.value })} /> updateSetting({ subPort: Number(v) || 0 })} /> updateSetting({ subPath: sanitizePath(e.target.value) })} onBlur={() => updateSetting({ subPath: normalizePath(allSetting.subPath) })} /> updateSetting({ subURI: e.target.value })} /> ), }, { key: '2', label: catTabLabel(, t('pages.settings.information'), isMobile), children: ( <> updateSetting({ subEncrypt: v })} /> updateSetting({ remarkTemplate: v })} maxLength={256} /> updateSetting({ subUpdates: Number(v) || 0 })} /> ), }, { key: '3', label: catTabLabel(, t('pages.settings.profile'), isMobile), children: ( <> updateSetting({ subTitle: e.target.value })} /> updateSetting({ subSupportUrl: e.target.value })} /> updateSetting({ subProfileUrl: e.target.value })} /> updateSetting({ subAnnounce: e.target.value })} /> {t('pages.settings.subThemeDirDesc')}{' '} {t('pages.settings.subThemeDirDocs')} )} > updateSetting({ subThemeDir: e.target.value })} /> ), }, { key: '4', label: catTabLabel(, t('pages.settings.certs'), isMobile), children: ( <> updateSetting({ subCertFile: e.target.value })} /> updateSetting({ subKeyFile: e.target.value })} /> ), }, { key: '5', label: catTabLabel(, 'Happ', isMobile), children: ( <> updateSetting({ subEnableRouting: v })} /> updateSetting({ subRoutingRules: e.target.value })} /> updateSetting({ subHideSettings: v })} /> ), }, { key: '6', label: catTabLabel(, 'Clash / Mihomo', isMobile), children: ( <> updateSetting({ subClashEnableRouting: v })} /> updateSetting({ subClashRules: e.target.value })} /> ), }, { key: '7', label: catTabLabel(, 'Incy', isMobile), children: ( <> updateSetting({ subIncyEnableRouting: v })} /> updateSetting({ subIncyRoutingRules: e.target.value })} /> ), }, ]} /> ); }