Rename website column. Table component.

This commit is contained in:
Mike Cao 2020-08-06 23:02:24 -07:00
parent a09867f28c
commit 000f84df96
8 changed files with 66 additions and 9 deletions

View file

@ -1,10 +1,32 @@
import React from 'react';
import React, { useState, useEffect } from 'react';
import Page from './Page';
import Table from './Table';
import { get } from 'lib/web';
const columns = [
{ key: 'name', label: 'Name' },
{ key: 'domain', label: 'Domain' },
];
export default function Settings() {
const [data, setData] = useState();
async function loadData() {
setData(await get(`/api/website`));
}
useEffect(() => {
loadData();
}, []);
if (!data) {
return null;
}
return (
<Page>
<h2>Settings</h2>
<Table columns={columns} rows={data.websites} />
</Page>
);
}