2020-10-29 18:16:13 +01:00
|
|
|
import { Table, Typography } from "antd";
|
|
|
|
|
|
|
|
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 = [
|
|
|
|
{
|
|
|
|
title: "Name",
|
|
|
|
dataIndex: "name",
|
|
|
|
key: "name",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Value",
|
|
|
|
dataIndex: "value",
|
|
|
|
key: "value",
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
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 {
|
|
|
|
title: string,
|
|
|
|
data: any,
|
|
|
|
};
|