// Drag-and-drop file uploader with per-file progress. Progressive enhancement:
// the markup is inert until /__wrnexus/uploader.js loads (auto-injected when a
// page contains `data-uploader`). Pairs with `handleUpload` on the server —
// files POST to `endpoint`, which returns `{ ok, files:[{ key, url, … }] }`.
//
//   <div data-component="file-upload" store="public" endpoint="/api/upload"
//        accept="image/*" max="10000000" multiple="true"></div>
component FileUpload {
  props {
    store = "public"
    endpoint = "/api/upload"
    accept = ""
    multiple = false
    max = 0
    label = "Drag files here or click to browse"
    class = ""
  }
  view {
    <div class="wire-fileupload {class}" data-uploader="{store}" data-endpoint="{endpoint}" data-accept="{accept}" data-multiple="{multiple}" data-max="{max}" data-label="{label}"></div>
  }
}
