(text: string | undefined)
| 40 | * 解析可本地化文本 - 如果以 '$' 开头,作为翻译键处理 |
| 41 | */ |
| 42 | const resolveText = (text: string | undefined): string => { |
| 43 | if (!text) return ''; |
| 44 | if (isTranslationKey(text)) { |
| 45 | return t(getTranslationKey(text)); |
| 46 | } |
| 47 | return text; |
| 48 | }; |
| 49 | |
| 50 | const [categories, setCategories] = useState<SettingCategory[]>([]); |
| 51 | const [selectedCategoryId, setSelectedCategoryId] = useState<string | null>(initialCategoryId || null); |
no test coverage detected