2021-02-04 18:19:16 +01:00
|
|
|
import { Table, Typography } from 'antd';
|
2020-10-29 18:16:13 +01:00
|
|
|
|
|
|
|
const { Title } = Typography;
|
|
|
|
|
2020-11-29 04:45:52 +01:00
|
|
|
export default function KeyValueTable({ title, data }: KeyValueTableProps) {
|
2020-10-29 18:16:13 +01:00
|
|
|
const columns = [
|
|
|
|
{
|
2021-02-04 18:19:16 +01:00
|
|
|
title: 'Name',
|
|
|
|
dataIndex: 'name',
|
|
|
|
key: 'name',
|
2020-10-29 18:16:13 +01:00
|
|
|
},
|
|
|
|
{
|
2021-02-04 18:19:16 +01:00
|
|
|
title: 'Value',
|
|
|
|
dataIndex: 'value',
|
|
|
|
key: 'value',
|
2020-10-29 18:16:13 +01:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
return (
|
2020-11-29 03:43:59 +01:00
|
|
|
<>
|
|
|
|
<Title level={2}>{title}</Title>
|
|
|
|
<Table pagination={false} columns={columns} dataSource={data} rowKey="name" />
|
|
|
|
</>
|
2020-10-29 18:16:13 +01:00
|
|
|
);
|
|
|
|
}
|
2020-11-29 04:45:52 +01:00
|
|
|
|
|
|
|
interface KeyValueTableProps {
|
2021-02-04 18:19:16 +01:00
|
|
|
title: string;
|
|
|
|
data: any;
|
|
|
|
}
|