'use client';import { a as a$2 } from './chunk-UPX6JFOI.js';
import { a as a$1 } from './chunk-YT7VOOFF.js';
import { a } from './chunk-TWGPE4V7.js';
import { cx } from '@onbeam/styled-system/css';
import { useDropzone } from 'react-dropzone-esm';
export { ErrorCode as b } from 'react-dropzone-esm';
import { dropzone, noiseBackground, gridBackground } from '@onbeam/styled-system/recipes';
import { jsx, jsxs } from 'react/jsx-runtime';

var k={i18n:{placeholderTitle:"Drag & drop your file here, or click to upload",uploadButton:"upload",replaceButton:"replace",removeButton:"remove",loadingText:"Uploading..."}},u=a(({as:v="div",fileSrc:p,label:z,hasError:D=!1,errorMessage:s,className:N,options:f,isLoading:g,onRemoveFile:b,...i},B)=>{let l=!!s||D,r={...k.i18n,...i.i18n},{getRootProps:y,getInputProps:h,open:x,isDragActive:E}=useDropzone({...f,noKeyboard:!0,multiple:!1,maxFiles:1}),o=dropzone(),a;return g?a=jsx("div",{className:o.dropzone,children:jsxs("div",{className:o.dropzoneContent,children:[jsx("span",{className:o.loadingText,children:r.loadingText}),jsx(a$1,{variant:"spinner",className:o.loader})]})}):p?a=jsxs("div",{className:o.imgItem,children:[jsx("div",{children:jsx("img",{className:o.img,src:p,alt:""})}),jsxs("div",{className:o.actions,children:[jsx(a$2,{size:"sm",type:"button",className:o.button,onClick:x,children:r.replaceButton}),jsx(a$2,{size:"sm",type:"button",className:o.button,onClick:b,children:r.removeButton})]})]}):a=jsx("div",{className:o.dropzone,...y(),children:jsxs("div",{className:o.dropzoneContent,children:[jsxs("div",{className:o.placeholder,children:[jsx("span",{className:o.placeholderTitle,children:r.placeholderTitle}),r.placeholderSubtitle&&jsx("span",{className:o.placeholderSubtitle,children:r.placeholderSubtitle})]}),jsx(a$2,{size:"sm",type:"button",children:r.uploadButton})]})}),jsxs("label",{className:cx(o.root,N),children:[z,jsxs(v,{ref:B,className:cx(noiseBackground(),gridBackground(),o.wrapper),"data-error":l,...i,children:[jsx("input",{...h()}),jsx("div",{className:o.container,"data-drag-active":E,"data-error":l,children:a})]}),s]})});u.displayName="Dropzone";

export { u as a };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-V3BF4LYC.js.map