2023-03-20 08:52:13 +01:00
|
|
|
import React from 'react';
|
2021-01-21 16:09:23 +01:00
|
|
|
|
2023-03-20 08:52:13 +01:00
|
|
|
import { Empty, Table, Button } from '@douyinfe/semi-ui';
|
|
|
|
|
import { IconDelete, IconEdit } from '@douyinfe/semi-icons';
|
2021-01-21 16:09:23 +01:00
|
|
|
|
2023-03-20 08:52:13 +01:00
|
|
|
export default function NotificationAdapterTable({ notificationAdapter = [], onRemove, onEdit } = {}) {
|
2021-01-21 16:09:23 +01:00
|
|
|
return (
|
2023-03-20 08:52:13 +01:00
|
|
|
<Table
|
|
|
|
|
pagination={false}
|
|
|
|
|
empty={<Empty description="No Data" />}
|
|
|
|
|
columns={[
|
|
|
|
|
{
|
|
|
|
|
title: 'Notification Adapter Name',
|
|
|
|
|
dataIndex: 'name',
|
|
|
|
|
},
|
2021-01-21 16:09:23 +01:00
|
|
|
|
2023-03-20 08:52:13 +01:00
|
|
|
{
|
|
|
|
|
title: '',
|
|
|
|
|
dataIndex: 'tools',
|
|
|
|
|
render: (_, record) => {
|
|
|
|
|
return (
|
2021-01-21 16:09:23 +01:00
|
|
|
<div style={{ float: 'right' }}>
|
2023-03-20 08:52:13 +01:00
|
|
|
<Button
|
|
|
|
|
type="secondary"
|
|
|
|
|
icon={<IconEdit />}
|
|
|
|
|
onClick={() => onEdit(record.id)}
|
|
|
|
|
style={{ marginRight: '1rem' }}
|
|
|
|
|
/>
|
|
|
|
|
<Button type="danger" icon={<IconDelete />} onClick={() => onRemove(record.id)} />
|
2021-01-21 16:09:23 +01:00
|
|
|
</div>
|
2023-03-20 08:52:13 +01:00
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
dataSource={notificationAdapter}
|
|
|
|
|
/>
|
2021-01-21 16:09:23 +01:00
|
|
|
);
|
|
|
|
|
}
|