require(`./chunk-BcutgqC9.cjs`);const e=require(`./utils-8yHOSEWy.cjs`),t=require(`./createLucideIcon-BDgzJx6F.cjs`),n=require(`./Badge.cjs`),r=require(`./Button.cjs`),i=require(`./Typography.cjs`),a=require(`./label-CO-KJo0v.cjs`);let o=require(`react`),s=require(`react/jsx-runtime`);var c=t.t(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),l=t.t(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);function u({onFileChange:t,children:u,...d}){let f=d.id||e.n(),[p,m]=(0,o.useState)([]),h=e=>{if(e.target.files){let n=[...Array.from(e.target.files)];d.multiple&&(n=[...p,...Array.from(e.target.files)]),m(n),t?.(n)}},g=e=>{let n=p.filter((t,n)=>n!==e);m(n),t?.(n)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:e.t(`flex flex-col items-center gap-4 mb-2.5 w-full`,d.className),children:[(0,s.jsx)(`input`,{...d,id:f,type:`file`,className:`hidden`,onChange:h}),(0,s.jsx)(`label`,{htmlFor:f,className:`flex w-full`,children:u||(0,s.jsxs)(`div`,{className:`flex flex-col w-full bg-primary-gray-200 dark:bg-primary-gray-600 px-4 py-6 items-center gap-2 border border-primary-gray-300 dark:border-primary-gray-550`,children:[(0,s.jsx)(l,{className:`w-7 h-7 stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-400`}),(0,s.jsx)(i.P,{className:`text-primary-gray-550 dark:text-primary-gray-300 text-sm md:text-sm`,children:`Click on this area to upload`})]})})]}),p.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.t,{children:`File(s) uploaded`}),(0,s.jsx)(`div`,{className:`w-full flex flex-wrap gap-2.5 justify-left mt-1`,children:p?.map((e,t)=>(0,s.jsxs)(n.Badge,{variant:`gray`,className:`flex gap-4 bg-primary-gray-200 dark:bg-primary-gray-600 border border-primary-gray-300 dark:border-primary-gray-600 pr-4 pl-4`,children:[(0,s.jsx)(`span`,{className:`truncate text-primary-gray-500 dark:text-primary-gray-400 text-base`,children:e.name}),(0,s.jsx)(r.Button,{variant:`icon`,padding:`none`,onClick:()=>g(t),children:(0,s.jsx)(c,{className:`w-4 h-4 stroke-accent-red`})})]},e.name))})]}):null]})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
//# sourceMappingURL=fileUpload-CUHOSZMy.cjs.map