'use client'; // Settings.tsx — 设置:偏好(语言/主题) + 设备管理(列表/移除/二次确认) + TOTP 2FA(绑定/验证/解禁)。 // 设计稿 §5:Web 用户中心「设置(含 2FA/TOTP 开关,用户可自选开启)」。 import React, { useEffect, useState } from 'react'; import { Icon } from './icons'; import { card, input } from './shared'; import { ErrorLine } from './Login'; import type { TFn, Lang } from '../lib/i18n'; import { getClient } from '../lib/api/client'; import { bilingual } from '../lib/api/errors'; import type { Device, TotpSetup } from '../lib/api/types'; export default function Settings({ t, lang, totpEnabled, onTotpChange }: { t: TFn; lang: Lang; totpEnabled: boolean; onTotpChange: () => void }) { return (