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

31 lines
557 B
TypeScript
Raw Normal View History

2021-02-04 20:19:16 +03:00
import { Table, Typography } from 'antd';
2020-10-29 20:16:13 +03:00
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 = [
{
2021-02-04 20:19:16 +03:00
title: 'Name',
dataIndex: 'name',
key: 'name',
2020-10-29 20:16:13 +03:00
},
{
2021-02-04 20:19:16 +03:00
title: 'Value',
dataIndex: 'value',
key: 'value',
2020-10-29 20:16:13 +03:00
},
];
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 {
2021-02-04 20:19:16 +03:00
title: string;
data: any;
}