{{#koenig-card tagName="figure" class=(concat (kg-style "media-card") " flex flex-column") isSelected=isSelected isEditing=isEditing selectCard=(action selectCard) deselectCard=(action deselectCard) editCard=(action editCard) toolbar=toolbar hasEditMode=false addParagraphAfterCard=addParagraphAfterCard moveCursorToPrevSection=moveCursorToPrevSection moveCursorToNextSection=moveCursorToNextSection editor=editor as |card| }} {{#gh-uploader files=files accept=imageMimeTypes extensions=imageExtensions onStart=(action "setPreviewSrc") onComplete=(action "updateSrc") onFailed=(action "resetSrcs") as |uploader| }}
{{#if (or previewSrc payload.src)}} {{payload.alt}} {{#if isDraggedOver}}
Drop to replace image
{{/if}} {{/if}} {{#if (or uploader.errors uploader.isUploading (not payload.src))}}
{{#if uploader.errors}} {{uploader.errors.firstObject.message}} {{/if}} {{#if isDraggedOver}} Drop it like it's hot 🔥 {{else if uploader.isUploading}} {{uploader.progressBar}} {{else if (not previewSrc payload.src)}} {{/if}}
{{/if}}
{{gh-file-input multiple=false action=uploader.setFiles accept=imageMimeTypes}}
{{/gh-uploader}} {{#if (or isSelected payload.caption)}} {{card.captionInput caption=payload.caption update=(action "updateCaption") placeholder="Type caption for image (optional)" }} {{/if}} {{/koenig-card}}