import{r as e}from"./chunk-QTnfLwEv.js";import{n as t,t as n}from"./jsx-runtime-BWRPWl8p.js";import{Li as r,zi as i}from"./index-DccLTdzK.js";import{t as a}from"./es-B2t4GvPL.js";var o=e(t(),1),s=n();function c(e){let{setImagenFile:t,imagenProductoBD:n}=e,[c,l]=(0,o.useState)([]),{getRootProps:u,getInputProps:d}=a({accept:`image/*, video/*`,onDrop:(0,o.useCallback)(e=>{l(e.map(e=>Object.assign(e,{preview:URL.createObjectURL(e)})));let n=e[0];t(n)})}),f=()=>{c.map((e,t)=>(e.type.split(`/`)[0],``))};(0,o.useEffect)(()=>{f()},[c]);let p=c.map(e=>(0,s.jsx)(`div`,{children:(0,s.jsx)(`div`,{children:(0,s.jsx)(i,{src:e?.preview,alt:`logo`})})},e?.name));return(0,s.jsxs)(`div`,{className:`archivo`,...u(),children:[n&&c.length===0?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(`aside`,{children:(0,s.jsx)(i,{src:n,alt:`logo`})})}):c.length!==0&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(`aside`,{children:p})}),(0,s.jsx)(r.Control,{...d()})]})}export{c as t};