Files
monkey-ai-web/src/components/table/admin-tokens/modals/AdminDeleteTokenModal.jsx
T
zhanjunhao 8a48765a46 chore(repo): 移除重复版权文件头并纳入共享单测
集中保留原版权声明,移除文件头检查和全局测试忽略规则。验证:全量单测、受影响用例复测及静态检查通过。
2026-11-20 11:23:49 +08:00

45 lines
1.2 KiB
React
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React from 'react';
import { Modal, Typography, Banner } from '@/components/ui';
const { Text } = Typography;
const AdminDeleteTokenModal = ({ visible, onCancel, onConfirm, token, t }) => {
if (!token) return null;
const isOrgToken = token.organization_id > 0;
return (
<Modal
title={t('确定要删除此密钥吗?')}
visible={visible}
onCancel={onCancel}
onOk={onConfirm}
type='danger'
okType='danger'
okText={t('确认删除')}
>
<div className='space-y-2'>
{isOrgToken && (
<Banner
type='warning'
description={t(
'该密钥属于企业 Token,删除将影响企业内多用户的使用',
)}
closeIcon={null}
/>
)}
<div>{t('删除后将无法恢复,且会立即终止使用此密钥的所有调用')}</div>
<Text type='tertiary' size='small'>
{t('密钥名称')}:{token.name || '—'}
</Text>
<br />
<Text type='tertiary' size='small'>
{t('所属用户')}:{token.display_name || token.username || '—'} (ID:{' '}
{token.user_id})
</Text>
</div>
</Modal>
);
};
export default AdminDeleteTokenModal;