import React, { Component } from 'react';
import { Link } from 'react-router-dom'
import { clamp, percent } from '../util'
export const Loader = () => (
)
export const Swatch = ({ color }) => (
)
export const Dot = ({ color }) => (
)
export const Columns = ({ count, margin, width, object, children, className }) => {
if (!object || !object.length) object = children
if (!object || !object.length) return null
margin = margin || 380
width = width || 250
count = count || Math.floor((window.innerWidth - margin) / width)
let columns = []
let len = object.length
let j = 0
for (let i = 0; i < count; i++) {
let column_len = len * (i + 1) / count
let column = []
for (; j < column_len; j++) {
column.push({object[j]}
)
}
columns.push({column}
)
if (j >= len) break
}
return (
{columns}
)
}
export const Statistic = ({ name, value, link }) => (
{link ? {name} : name}
{value}
)
export const Detections = ({ detections, labels }) => (
(detections || []).map(({ label, rect }, i) => (
{labels && {label.replace(/_/g, ' ')}}
)
))
export const Progress = ({ current, total }) => (
)