From ee3d0d98e19f1d8177d85af1866fd0ee431fe9ea Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 25 Nov 2018 22:19:15 +0100 Subject: moving stuff --- scraper/client/common/keyframe.component.js | 118 ++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 scraper/client/common/keyframe.component.js (limited to 'scraper/client/common/keyframe.component.js') diff --git a/scraper/client/common/keyframe.component.js b/scraper/client/common/keyframe.component.js new file mode 100644 index 00000000..c77db3ac --- /dev/null +++ b/scraper/client/common/keyframe.component.js @@ -0,0 +1,118 @@ +import React from 'react' +import { Link } from 'react-router-dom' +import { imageUrl, timestamp, keyframeUri, widths, verify } from '../util' +import { DetectionBoxes } from '.' + +import * as searchActions from '../search/search.actions' + +export default function Keyframe({ + verified, + sha256, + frame, + score, + isSaved, + fps = 25, + size = 'th', + className, + showHash, + showFrame, + showTimestamp, + showScore, + showSearchButton, + showSaveButton, + to, + children, + detectionList = [], + aspectRatio = 1.777, + onClick, + reviewActions, +}) { + if (!sha256) return null + const width = widths[size] + const height = Math.round(width / aspectRatio) + return ( +
+
+ + {'Frame + {detectionList.map(({ labels, detections }, i) => ( + + ))} + + {(reviewActions && (showSearchButton || showSaveButton)) && + + } +
+ {(showHash || showFrame || showTimestamp || showScore) && + + } + {children} +
+ ) +} + +const PossiblyExternalLink = props => { + if (props.onClick) { + return props.children + } + if (props.to.match(/^http/)) { + return {props.children} + } + return +} -- cgit v1.2.3-70-g09d2