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

29 lines
731 B
React
Raw Normal View History

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