owncast/web/pages/components/key-value-table.tsx

30 lines
558 B
TypeScript
Raw Normal View History

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