import { api } from '../api.js'; import { showToast } from '../components/toast.js'; import { esc } from '../utils.js'; function formatFileSize(bytes) { if (!bytes) return '--'; if (bytes >= 1073741824) return `${(bytes / 1073741824).toFixed(1)} GB`; if (bytes >= 1048576) return `${(bytes / 1048576).toFixed(1)} MB`; if (bytes >= 1024) return `${(bytes / 1024).toFixed(0)} KB`; return `${bytes} B`; } export function render(container) { container.innerHTML = `
Drop files here or click to upload
Supports MP4, WebM, AVI, MKV, JPEG, PNG, GIF, WebP
Stream directly from a URL. Saves local bandwidth.
Embed a YouTube video on your displays.
Upload videos and images to get started.
${esc(err.message)}
Leave empty to keep current file