Files
hms/apps/miniprogram/src/components/EmptyState/index.tsx
iven 81c174a902
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
fix(miniprogram): 修复多角色找茬测试 V3 发现的 8 个问题
1. EmptyState 默认 emoji 📭 → serif 首字圆形图标(影响 23 处使用)
2. 预约页英文副标题 "Appointment" 移除
3. consultation 页技术错误信息直接渲染到 UI → 用户友好提示
4. auth store restore() 增加 fallback:secureGet 失败时读 wx.getStorageSync
5. request.ts 新增 safeGet():token/tenantId 读取容错
6. doctor/consultation useMemo 自引用死循环 → Math.ceil(total/20)
7. doctor/alerts 同样自引用 bug 修复
8. doctor/patients 死代码 totalPages + useMemo import 清理
2026-05-08 17:34:42 +08:00

36 lines
909 B
TypeScript

import React from 'react';
import { View, Text } from '@tarojs/components';
import './index.scss';
interface EmptyStateProps {
icon?: string;
text: string;
hint?: string;
actionText?: string;
onAction?: () => void;
}
export default React.memo(function EmptyState({
icon,
text,
hint,
actionText,
onAction,
}: EmptyStateProps) {
const displayChar = icon || text.charAt(0);
return (
<View className='empty-state'>
<View className='empty-state-icon-wrap'>
<Text className='empty-state-icon-char'>{displayChar}</Text>
</View>
<Text className='empty-state-text'>{text}</Text>
{hint && <Text className='empty-state-hint'>{hint}</Text>}
{actionText && onAction && (
<View className='empty-state-action' onClick={onAction}>
<Text className='empty-state-action-text'>{actionText}</Text>
</View>
)}
</View>
);
});