<div class="sidebar-panel">
	<div class="title">Attachments</div>
	<div class="document-sidebar-view-attachments">
		{{#if isEditor}}
			<div id="upload-document-files" class="upload-document-files">
				Drag-drop files or click to select files
			</div>
		{{/if}}
		<ul class="list">
			{{#each files key="id" as |a index|}}
				<li class="item">
					<img class="icon" src="/assets/img/attachments/{{document/file-icon a.extension}}" />
					<a href="{{ appMeta.endpoint }}/public/attachments/{{ appMeta.orgId }}/{{ a.id }}">
						<span class="file">{{ a.filename }}</span>
					</a>
					{{#if isEditor}}
						<div class="action round-button-mono">
							<i class="material-icons color-gray delete-attachment-{{a.id}}" title="Delete" {{action 'onConfirmDelete' a.id a.filename}}>delete</i>
						</div>
					{{/if}}
				</li>
			{{/each}}
		</ul>
		{{#if emptyState}}
			<div class="explainer">
				<div class="empty-state">
					There are no attachments
				</div>
			</div>
		{{/if}}
	</div>

	<div class="dropdown-dialog delete-attachment-dialog">
		<div class="content">
			<p>Are you sure you want to delete <span class="bold">{{deleteAttachment.name}}?</span></p>
		</div>
		<div class="actions">
			<div class="flat-button" {{action 'onCancel'}}>
				cancel
			</div>
			<div class="flat-button flat-red" {{action 'onDelete'}}>
				delete
			</div>
		</div>
		<div class="clearfix"></div>
	</div>
</div>