enable viewing results as listview

This commit is contained in:
2023-01-20 12:50:45 +01:00
parent 1f192f48f4
commit 0c737b2a3e
7 changed files with 149 additions and 36 deletions

View File

@@ -13,7 +13,7 @@ import {
Typography
} from "@mui/material";
import { useEffect, useState } from "react";
import { ellipsis } from "../utils";
import { ellipsis, formatSpeedMiB, roundMiB } from "../utils";
type Props = {
title: string,
@@ -42,6 +42,8 @@ export function StackableResult({
}
}, [percentage])
const percentageToNumber = () => isCompleted ? 100 : Number(percentage.replace('%', ''))
const guessResolution = (xByY: string): any => {
if (!xByY) return null;
if (xByY.includes('4320')) return (<EightK color="primary" />);
@@ -51,11 +53,6 @@ export function StackableResult({
return null;
}
const percentageToNumber = () => isCompleted ? 100 : Number(percentage.replace('%', ''))
const roundMiB = (bytes: number) => `${(bytes / 1_000_000).toFixed(2)} MiB`
const formatSpeedMiB = (val: number) => `${roundMiB(val)}/s`
return (
<Card>
<CardActionArea>