mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-02 22:17:18 +01:00
25 lines
615 B
TypeScript
25 lines
615 B
TypeScript
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>
|
|
);
|
|
}
|