Skip to content
export default ({ item, onClick, className }) => {
function bytesToSize(bytes) {
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
if (bytes == 0) return "0 Byte";
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
}
function formatDate(date) {
return new Date(date).toLocaleString();
}
const isEncoding = () => {
return !!item?.encodeProgress && item.encodeProgress !== 100;
};
return (
{item?.title}
{isEncoding() && (
Encoding...
)}
{!isEncoding() && (
{bytesToSize(item?.size)}
)}
{!isEncoding() && (
{formatDate(item.updated_at)}
)}
);
};