import{j as e}from"./index-7c7a558c.js";const p=({files:i,setFiles:n,previews:a,setPreviews:d})=>{const c=t=>{const r=Array.from(t.target.files),l=[...i,...r];n(l);const o=[...a,...r.map(s=>URL.createObjectURL(s))];d(o)},x=t=>{const r=i.filter((o,s)=>s!==t),l=a.filter((o,s)=>s!==t);n(r),d(l)};return e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center justify-center w-[50%]",children:e.jsxs("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-gray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[e.jsx("svg",{className:"w-8 h-8 mb-4 text-gray-500 dark:text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:e.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),e.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[e.jsx("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),e.jsx("input",{id:"dropzone-file",type:"file",className:"hidden",multiple:!0,onChange:c})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:a.map((t,r)=>e.jsxs("div",{style:{position:"relative",margin:"10px",display:"inline-block"},children:[e.jsx("img",{src:t,alt:`Preview ${r+1}`,style:{width:"100px",height:"100px",objectFit:"cover"}}),e.jsx("button",{className:"absolute  text-2xl top-[1px] right-[1px] bg-red-600 w-5 h-5 flex items-center justify-center text-white border-none rounded-full cursor-pointer",onClick:()=>x(r),children:"×"})]},r))})]})};export{p as M};
