import { Center, Group, Progress, ScrollArea, Table, TableTbody, TableTd, TableTh, TableThead, TableTr, Text, Title, Tooltip, } from "@mantine/core"; import { IconHeartbeat, IconTransform } from "@tabler/icons-react"; import type { TdarrWorker } from "@homarr/integrations"; import { useI18n } from "@homarr/translation/client"; interface WorkersPanelProps { workers: TdarrWorker[]; isTiny: boolean; } export function WorkersPanel(props: WorkersPanelProps) { const t = useI18n("widget.mediaTranscoding.panel.workers"); if (props.workers.length === 0) { return (
{t("empty")}
); } return ( {t("table.file")} {t("table.eta")} {t("table.progress")} {props.workers.map((worker) => { const fileName = worker.filePath.split("\\").pop()?.split("/").pop() ?? worker.filePath; return (
{worker.jobType === "transcode" ? ( ) : ( )}
{fileName}
{worker.ETA.startsWith("0:") ? worker.ETA.substring(2) : worker.ETA} {!props.isTiny && ( <> {worker.step} )} {Math.round(worker.percentage)}%
); })}
); }