import * as React from "react"; import * as Constants from "~/common/constants"; import * as Strings from "~/common/strings"; import { css } from "@emotion/react"; const STYLES_CONTAINER = css` border-radius: 16px; box-shadow: 0 0 0 1px ${Constants.semantic.borderGrayLight} inset, ${Constants.shadow.lightSmall}; padding: 32px; max-width: 100%; width: 100%; ${"" /* background-color: ${Constants.system.white}; */} @media (max-width: ${Constants.sizes.mobile}px) { padding: 24px; } `; const STYLES_ROW = css` font-family: ${Constants.font.code}; color: ${Constants.system.grayLight2}; background-color: ${Constants.semantic.bgLight}; display: inline-flex; height: 16px; width: 100%; `; const STYLES_STATS_ROW = css` background-color: ${Constants.semantic.bgLight}; 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: 12px; overflow-wrap: break-word; `; const STYLES_NOTE = css` margin-top: 12px; font-family: ${Constants.font.text}; font-size: ${Constants.typescale.lvl0}; color: ${Constants.system.grayLight2}; display: block; `; 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 (
); }; export const DataMeterDetailed = (props) => { return (
{Strings.bytesToSize(props.stats.bytes)} of {Strings.bytesToSize(props.stats.maximumBytes)}{" "} used
{" "}
Images
{" "}
Videos
{" "}
Books
{" "}
PDF
{" "}
Audio
{props.buttons ?
{props.buttons}
: null}
); }; export default DataMeterDetailed;