import * as React from "react";
import * as Constants from "~/common/constants";
import * as Strings from "~/common/strings";
import { css } from "@emotion/core";
const STYLES_CONTAINER = css`
border-radius: 4px;
box-shadow: 0 0 0 1px ${Constants.system.lightBorder} inset, 0 0 40px 0 ${Constants.system.shadow};
padding: 32px;
max-width: 100%;
width: 100%;
@media (max-width: ${Constants.sizes.mobile}px) {
padding: 24px;
}
`;
const STYLES_ROW = css`
font-family: ${Constants.font.code};
color: ${Constants.system.darkGray};
background-color: ${Constants.system.foreground};
display: inline-flex;
height: 16px;
width: 100%;
`;
const STYLES_STATS_ROW = css`
background-color: ${Constants.system.foreground};
width: 100%;
border-radius: 3px;
height: 16px;
`;
const STYLES_TITLE = css`
font-family: ${Constants.font.medium};
font-size: ${Constants.typescale.lvl1};
display: block;
margin-bottom: 4px;
overflow-wrap: break-word;
`;
const STYLES_NOTE = css`
margin-top: 8px;
font-family: ${Constants.font.text};
font-size: ${Constants.typescale.lvl0};
color: ${Constants.system.darkGray};
display: block;
margin-bottom: 4px;
`;
const STYLES_DATA_METER_KEY_WRAPPER = css`
display: inline-block;
`;
const STYLES_DATA_METER_KEY_SQUARE = css`
display: inline-block;
border-radius: 3px;
background: #73ad21;
width: 12px;
height: 12px;
margin-right: 4px;
vertical-align: middle;
`;
const STYLES_DATA_METER_KEY_LABEL = css`
display: inline-block;
margin-right: 16px;
vertical-align: middle;
`;
const DATA_METER_METER_SEGMENT = css`
height: 16px;
`;
export const DataMeterBar = (props) => {
const percentageUsed = props.bytes / props.maximumBytes;
const percentageImage = props.stats.imageBytes / props.bytes;
const percentageVideo = props.stats.videoBytes / props.bytes;
const percentageEpub = props.stats.epubBytes / props.bytes;
const percentagePdf = props.stats.pdfBytes / props.bytes;
const percentageAudio = props.stats.audioBytes / props.bytes;
const percentageFreeSpace = props.bytes - props.maximumBytes;
return (