single <p> for latest edit

This commit is contained in:
Ed Chalstrey 2022-08-09 15:14:18 +01:00
parent 0b9598f47b
commit 9863e99cb6

View File

@ -27,16 +27,11 @@ const EditHistoryLatest: React.FunctionComponent<EditHistoryLatestProps> = (prop
fetchData(); // define and call, because effect cannot return anything and an async fn always returns a Promise
}
}, [props.building]); // only re-run effect on building prop change
return (
<>
<ul className="edit-history-list">
{history && history.map(entry => (
<li key={`${entry.revision_id}`} className="edit-history-list-element">
<BuildingEditLatest historyEntry={entry} />
</li>
))}
</ul>
<p key={`${history[0].revision_id}`} className="edit-history-list-element">
<BuildingEditLatest historyEntry={history[0]} />
</p>
</>
);
};