Files
fredy/ui/src/components/table/NotificationAdapterTable.jsx

44 lines
1.2 KiB
React
Raw Normal View History

2025-12-11 10:40:55 +01:00
/*
* Copyright (c) 2026 by Christian Kellner.
2025-12-11 10:40:55 +01:00
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
*/
2023-03-20 08:52:13 +01:00
import React from 'react';
2023-03-20 08:52:13 +01:00
import { Empty, Table, Button } from '@douyinfe/semi-ui';
import { IconDelete, IconEdit } from '@douyinfe/semi-icons';
2023-03-20 08:52:13 +01:00
export default function NotificationAdapterTable({ notificationAdapter = [], onRemove, onEdit } = {}) {
return (
2023-03-20 08:52:13 +01:00
<Table
pagination={false}
empty={<Empty description="No notification adapters found." />}
2023-03-20 08:52:13 +01:00
columns={[
{
title: 'Name',
2023-03-20 08:52:13 +01:00
dataIndex: 'name',
},
2023-03-20 08:52:13 +01:00
{
title: '',
dataIndex: 'tools',
render: (_, record) => {
return (
<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)} />
</div>
2023-03-20 08:52:13 +01:00
);
},
},
]}
dataSource={notificationAdapter}
/>
);
}