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

43 lines
1.1 KiB
React
Raw Normal View History

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 } from '@douyinfe/semi-icons';
2023-03-20 08:52:13 +01:00
export default function ProviderTable({ providerData = [], onRemove } = {}) {
return (
2023-03-20 08:52:13 +01:00
<Table
pagination={false}
empty={<Empty description="No Provider available" />}
columns={[
{
title: 'Provider Name',
dataIndex: 'name',
},
{
title: 'Provider Url',
dataIndex: 'url',
render: (_, data) => {
return (
<a href={data.url} target="_blank" rel="noopener noreferrer">
Visit site
</a>
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="danger" icon={<IconDelete />} onClick={() => onRemove(record.id)} />
</div>
2023-03-20 08:52:13 +01:00
);
},
},
]}
dataSource={providerData}
/>
);
}