import { EightK, FourK, Hd, Sd } from "@mui/icons-material";
import { Button, Card, CardActionArea, CardActions, CardContent, CardMedia, Chip, LinearProgress, Skeleton, Stack, Typography } from "@mui/material";
import { IMessage } from "../interfaces";
import { ellipsis } from "../utils";
type Props = {
title: string,
thumbnail: string,
resolution: string
percentage: string,
size: number,
speed: number,
stopCallback: VoidFunction,
}
export function StackableResult({
title,
thumbnail,
resolution,
percentage,
speed,
size,
stopCallback
}: Props) {
const guessResolution = (xByY: string): any => {
if (!xByY) return null;
if (xByY.includes('4320')) return ();
if (xByY.includes('2160')) return ();
if (xByY.includes('1080')) return ();
if (xByY.includes('720')) return ();
return null;
}
const percentageToNumber = () => Number(percentage.replace('%', ''))
const roundMB = (bytes: number) => `${(bytes / 1_000_000).toFixed(2)}MiB`
return (
{thumbnail !== '' ?
:
}
{title !== '' ?
{ellipsis(title, 54)}
:
}
{percentage}
{speed}
{roundMB(size ?? 0)}
{guessResolution(resolution)}
{percentage ?
:
null
}
)
}