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

31 lines
796 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-04-01 01:04:01 +02:00
<section className="card__content">
{history.map(({ lastViewed, uri }) => (
<NavigationHistoryItem slim key={uri} uri={uri} lastViewed={lastViewed} />
))}
</section>
<div className="card__actions">
<Button navigate="/$/history/all" button="link" label={__('See All Visited Links')} />
</div>
</div>
) : null;
}