mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
* migra for distance * adding distance calculator * adding ability to store home address * improve distance calculation * calculating distance * show distance in grid view * upgrading dependencies * moving to react 19 * ability to clone a job * fixing tests * polishing
50 lines
1.4 KiB
JavaScript
50 lines
1.4 KiB
JavaScript
/*
|
|
* Copyright (c) 2026 by Christian Kellner.
|
|
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
|
|
*/
|
|
|
|
import React from 'react';
|
|
|
|
import { Empty, Table, Button } from '@douyinfe/semi-ui-19';
|
|
import { IconDelete, IconEdit } from '@douyinfe/semi-icons';
|
|
|
|
export default function ProviderTable({ providerData = [], onRemove, onEdit } = {}) {
|
|
return (
|
|
<Table
|
|
pagination={false}
|
|
empty={<Empty description="No providers found." />}
|
|
columns={[
|
|
{
|
|
title: 'Name',
|
|
dataIndex: 'name',
|
|
},
|
|
{
|
|
title: 'URL',
|
|
dataIndex: 'url',
|
|
render: (_, data) => {
|
|
return (
|
|
<a href={data.url} target="_blank" rel="noopener noreferrer">
|
|
Visit site
|
|
</a>
|
|
);
|
|
},
|
|
},
|
|
{
|
|
title: '',
|
|
dataIndex: 'tools',
|
|
render: (_, record) => {
|
|
return (
|
|
<div style={{ float: 'right' }}>
|
|
<Button type="secondary" icon={<IconEdit />} onClick={() => onEdit(record)} />
|
|
<div style={{ display: 'inline-block', width: '16px' }} />
|
|
<Button type="danger" icon={<IconDelete />} onClick={() => onRemove(record.url)} />
|
|
</div>
|
|
);
|
|
},
|
|
},
|
|
]}
|
|
dataSource={providerData}
|
|
/>
|
|
);
|
|
}
|