2aa9d73325
集中保留原版权声明,移除文件头检查和全局测试忽略规则。验证:全量单测、受影响用例复测及静态检查通过。
51 lines
1.1 KiB
React
51 lines
1.1 KiB
React
import React from 'react';
|
|
import { Copy, Plus, Trash2 } from '@/components/common/icons/ActionIcons';
|
|
import { Button } from '@/components/ui';
|
|
import { isAdmin } from '../../../helpers';
|
|
|
|
const RedemptionsActions = ({
|
|
selectedKeys,
|
|
setEditingRedemption,
|
|
setShowEdit,
|
|
batchCopyRedemptions,
|
|
batchDeleteRedemptions,
|
|
t,
|
|
}) => {
|
|
// Add new redemption code
|
|
const handleAddRedemption = () => {
|
|
setEditingRedemption({
|
|
id: undefined,
|
|
});
|
|
setShowEdit(true);
|
|
};
|
|
|
|
return (
|
|
<div className='console-list-tool-actions'>
|
|
<Button icon={<Copy size={16} />} onClick={batchCopyRedemptions}>
|
|
{t('复制所选兑换码到剪贴板')}
|
|
</Button>
|
|
|
|
{isAdmin() && (
|
|
<Button
|
|
type='danger'
|
|
icon={<Trash2 size={16} />}
|
|
onClick={batchDeleteRedemptions}
|
|
>
|
|
{t('清除失效兑换码')}
|
|
</Button>
|
|
)}
|
|
{isAdmin() && (
|
|
<Button
|
|
type='primary'
|
|
icon={<Plus size={16} />}
|
|
onClick={handleAddRedemption}
|
|
>
|
|
{t('添加兑换码')}
|
|
</Button>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default RedemptionsActions;
|