cd75141037
P1 thiserror 类型化错误: 新增 core/src/error.rs QrError 枚举, 全链 String -> QrError, 包括 EmptyInput/InvalidVersion/DataTooLong/DecodeFail 等 8 种变体 P2 text_builder Tauri 统一: 新增 build_qr_text Tauri command, 删除前端 qrText.ts, 所有 mode 组件改为 invoke 调用 Rust 端构建文本 P3 QrConfig 颜色字段移除: 从 QrConfig/QrCode 移除 fg_color/bg_color, 改为 to_svg/to_image_bytes 参数传递 P4 前端 4 项合并: Context 拆分为 StateContext+DispatchContext (H10), 新建 useModeForm 通用 hook (M11), VCardMode grid-cols-2 网格布局 (M13), persistHistory/loadHistory 迁至 utils/storage.ts (L9) P5 算法优化: MaskedView 懒计算替代 8 次 Matrix 克隆 (H9), encoding_rs 精确 Kanji Shift JIS 映射 (H12) 验证: cargo check+clippy 通过, 81+24+7 全部测试通过
18 lines
572 B
TypeScript
18 lines
572 B
TypeScript
import { useTranslation } from 'react-i18next';
|
|
import { useModeForm } from '../hooks/useModeForm';
|
|
|
|
export default function PhoneMode() {
|
|
const { t } = useTranslation();
|
|
const { formData, update } = useModeForm('phone');
|
|
|
|
return (
|
|
<input
|
|
type="tel"
|
|
placeholder={t('phone.placeholder')}
|
|
value={formData.number || ''}
|
|
onChange={(e) => update('number', e.target.value)}
|
|
className="w-full h-full px-4 text-sm bg-transparent outline-none placeholder-gray-400 dark:placeholder-gray-600 focus:ring-2 focus:ring-blue-500/30"
|
|
/>
|
|
);
|
|
}
|