start over with nextjs

This commit is contained in:
Thomas Ruoff
2021-02-25 00:31:28 +01:00
parent 3a77e7f22b
commit 214d95d3d7
68 changed files with 3047 additions and 18576 deletions

24
components/LatestList.tsx Normal file
View File

@@ -0,0 +1,24 @@
import React from 'react';
import Button from './Button';
export default function(props) {
const latest = props.latest || [];
const latestElements = latest.map(item => {
const created = new Date(item.created);
const hrefId = `#item-${item.id}`;
return (
<li key={item.id}>
<a href={hrefId} onClick={() => props.onSelect(item)}>{created.toLocaleString()}</a>
<span> </span>
<Button onClick={() => props.onRemove(item)}>Remove</Button>
</li>
);
});
return (
<div>
<h4>Vergangene Briefe:</h4>
<ul>{latestElements}</ul>
</div>
);
}