<div class="documents-list">
	{{#each documents key="id" as |document|}}
		<div id="document-{{document.id}}">
			<div class="document-item {{if document.selected "selected-card"}}">
				{{#link-to 'document.index' folder.id folder.slug document.id document.slug class="link"}}
					<div class="title">{{ document.name }}</div>
					<div class="snippet">{{ document.excerpt }}</div>
					<div class="chips">{{folder/document-tags documentTags=document.tags}}</div>
				{{/link-to}}
				<div class="checkbox" {{action 'selectDocument' document.id}}>
					{{#if session.authenticated}}
						{{#if document.selected}}
							<i class="material-icons">check_box</i>
						{{else}}
							<i class="material-icons">check_box_outline_blank</i>
						{{/if}}
					{{/if}}
				</div>
			</div>
			{{#if canCreate}}
				<div class="wizard-item start-document" {{action 'onShowDocumentWizard' document.id}}>
					<div class="start-button">
						<div class="round-button round-button-small button-green">
							<i class="material-icons">add</i>
						</div>
						<div class="label">document</div>
					</div>
				</div>
			{{else}}
				<div class="no-wizard-item" />
			{{/if}}
		</div>
	{{/each}}
</div>

{{folder/start-document folder=folder isEditor=isEditor onImport=(action 'onImport') onHideDocumentWizard=(action 'onHideDocumentWizard')}}

{{#if emptyState}}
	{{#if canCreate}}
		<div class="start-document start-document-empty-state" {{action 'onShowDocumentWizard' ''}}>
			<div class="start-button">
				<div class="round-button round-button-small button-green">
					<i class="material-icons">add</i>
				</div>
				<div class="label">document</div>
			</div>
		</div>
	{{/if}}
{{/if}}

<div id="wizard-placeholder" class="hide" />

{{#if emptyState}}
	<div class="regular-button button-red margin-top-50" {{action 'onDelete'}}>delete space</div>
{{/if}}
