forked from WebMemex/webmemex-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VisitAsListItem.js
36 lines (31 loc) · 1.08 KB
/
VisitAsListItem.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react'
import classNames from 'classnames'
import {localVersionAvailable, LinkToLocalVersion } from '../../page-viewer'
const VisitAsListItem = ({doc, compact}) => (
<a
className={classNames("VisitAsListItem", {compact})}
href={doc.page.url}
title={doc.page.url}
// DEBUG Show document props on meta+click
onClick={e=>{if (e.metaKey) {console.log(doc); e.preventDefault()}}}
>
{doc.page.screenshot
? <img className="thumbnail" src={doc.page.screenshot} />
: null
}
<div className="caption">
<span className="title" title={doc.page.title}>
{doc.page.favIcon
? <img className="favIcon" src={doc.page.favIcon} />
: null
}
{doc.page.title}
</span>
{localVersionAvailable({page: doc.page})
? <LinkToLocalVersion page={doc.page}>💾</LinkToLocalVersion>
: null
}
</div>
</a>
)
export default VisitAsListItem