import{a as e}from"./chunk-BNv3lrIs.js";import{n as t,t as n}from"./jsx-runtime-pmtNMKr4.js";import"./toast-hrvP3G3Q.js";import{Si as r,bi as i}from"./index-CBXvBSuP.js";import{t as a}from"./es-DCiMJKAU.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)(r,{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)(r,{src:n,alt:`logo`})})}):c.length!==0&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(`aside`,{children:p})}),(0,s.jsx)(i.Control,{...d()})]})}export{c as t};