简化过度设计,恢复原生弹窗
- 删除 ConfirmModal 和 MessageModal 组件 - 恢复原生 alert() 和 confirm() 弹窗 - 移除不必要的加载状态指示器 - 移除切换供应商的确认对话框 - 简化代码,提升响应速度和用户体验
This commit is contained in:
@@ -8,7 +8,6 @@ interface ProviderListProps {
|
||||
onSwitch: (id: string) => void
|
||||
onDelete: (id: string) => void
|
||||
onEdit: (id: string) => void
|
||||
isLoading?: boolean
|
||||
}
|
||||
|
||||
const ProviderList: React.FC<ProviderListProps> = ({
|
||||
@@ -16,8 +15,7 @@ const ProviderList: React.FC<ProviderListProps> = ({
|
||||
currentProviderId,
|
||||
onSwitch,
|
||||
onDelete,
|
||||
onEdit,
|
||||
isLoading = false
|
||||
onEdit
|
||||
}) => {
|
||||
return (
|
||||
<div className="provider-list">
|
||||
@@ -54,21 +52,20 @@ const ProviderList: React.FC<ProviderListProps> = ({
|
||||
<button
|
||||
className="enable-btn"
|
||||
onClick={() => onSwitch(provider.id)}
|
||||
disabled={isCurrent || isLoading}
|
||||
disabled={isCurrent}
|
||||
>
|
||||
{isLoading ? '处理中...' : '启用'}
|
||||
启用
|
||||
</button>
|
||||
<button
|
||||
className="edit-btn"
|
||||
onClick={() => onEdit(provider.id)}
|
||||
disabled={isLoading}
|
||||
>
|
||||
编辑
|
||||
</button>
|
||||
<button
|
||||
className="delete-btn"
|
||||
onClick={() => onDelete(provider.id)}
|
||||
disabled={isCurrent || isLoading}
|
||||
disabled={isCurrent}
|
||||
>
|
||||
删除
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user