lbry-desktop/ui/component/navigationHistoryRecent/view.jsx

29 lines
731 B
React
Raw Normal View History

2019-03-31 19:04:01 -04:00
// @flow
2019-05-06 22:35:04 -04:00
import React from 'react';
2019-03-31 19:04:01 -04:00
import Button from 'component/button';
import NavigationHistoryItem from 'component/navigationHistoryItem';
type HistoryItem = {
uri: string,
lastViewed: number,
};
type Props = {
history: Array<HistoryItem>,
};
2019-05-06 22:35:04 -04:00
export default function NavigationHistoryRecent(props: Props) {
const { history = [] } = props;
2019-03-31 19:04:01 -04:00
return history.length ? (
<div className="card item-list">
2019-07-21 17:31:22 -04:00
{history.map(({ lastViewed, uri }) => (
<NavigationHistoryItem slim key={uri} uri={uri} lastViewed={lastViewed} />
))}
2019-03-31 19:04:01 -04:00
<div className="card__actions">
2019-06-11 14:10:58 -04:00
<Button navigate="/$/library/all" button="link" label={__('See All Visited Links')} />
2019-03-31 19:04:01 -04:00
</div>
</div>
) : null;
}