@typeparam CFile

<div class="filesWithEditor">

	<div class="filterFiles">
		<div class="field has-addons">
			<div class="control has-icons-left is-expanded">
				<input formnovalidate @oninput="e => SearchInputChanged(e.Value.ToString())" class="input is-rounded is-small" type="text" placeholder="Search...">
				<span class="icon is-small is-left">
					<i class="mdi mdi-search-web"></i>
				</span>
			</div>
			<div class="control has-icons-left">
				<div class="select is-small is-rounded">
					<select @onchange="e => OnFilterClick(e.Value.ToString())">
						@foreach (var filter in Filters)
						{
							<option value="@filter">@filter</option>
						}
					</select>
				</div>
				<span class="icon is-small is-left">
					<i class="mdi mdi-folder-cog-outline"></i>
				</span>
			</div>
		</div>
	</div>

	<div class="fileTitle">
		@if (IsAnyFileSelected)
		{
			<div class="level">
				<div class="level-left">
					<div class="level-item">
						<p class="subtitle is-5">
							@SelectedFile.Name
						</p>
					</div>
				</div>
				<div class="level-right">
					<div class="level-item">
						<button class="button is-small is-rounded neoBtn" @onclick="OnFileClick">
							<span class="icon is-medium">
								<i class="mdi mdi-close"></i>
							</span>
						</button>
					</div>
				</div>
			</div>
		}
		else
		{
			<p>Select any file to start editing...</p>
		}
	</div>

	<div class="files">
		<div class="filesList neomorphInsetSmall borderR sameMarginBottom">
			@foreach (var file in Files)
			{
			<div @onclick="e => OnFileClick(e,file)" @key="file" class="confFile borderRSmall neoFile @file.IsVisible @file.IsSelected">
				<p class="is-7">@file.Folder</p>
				<p class="has-text-weight-bold @(file.CanBeDeleted ? null : "has-text-danger")">@file.Name</p>
			</div>
			}
		</div>
	</div>

	<div class="codeEditor">
		@if (IsAnyFileSelected)
		{
			<div class="content">
				<textarea class="textarea" placeholder="Uhu" rows="20" @bind="SelectedFile.OriginalBody"></textarea>
			</div>
		}
		else
		{
			<span></span>
		}
	</div>

	<div class="filesActions">
		<div class="buttons is-centered">
			<button class="button is-rounded neoBtn is-small noBottomMargin" @onclick="OnAddDialog">
				<span class="icon is-small has-text-success">
					<i class="mdi mdi-plus-box-outline"></i>
				</span>
				<span>Add</span>
			</button>
			<button class="button is-rounded neoBtn is-small noBottomMargin @IsSelectedFileDeletable" @onclick="OnDeleteDialog">
				<span class="icon is-small has-text-danger">
					<i class="mdi mdi-minus-box-outline"></i>
				</span>
				<span>Delete</span>
			</button>
		</div>
	</div>

	<div class="editorActions">
		@if (IsAnyFileSelected)
		{
			<div class="buttons is-centered">
				<button class="button is-rounded neoBtn is-small has-icon-left noBottomMargin"><span class="icon is-left has-text-light"><i class="mdi mdi-content-save-outline"></i></span> <span>Save draft</span></button>
				<button class="button is-rounded neoBtn is-small has-icon-left noBottomMargin"><span class="icon is-left has-text-dark"><i class="mdi mdi-undo-variant"></i></span> <span>Undo changes</span></button>
				<button class="button is-rounded neoBtn is-small has-icon-left noBottomMargin"><span class="icon is-left has-text-success"><i class="mdi mdi-content-save-all-outline"></i></span> <span>Save</span></button>
				<button class="button is-rounded neoBtn is-small has-icon-left noBottomMargin"><span class="icon is-left has-text-danger"><i class="mdi mdi-alert-outline"></i></span> <span>Test</span></button>
			</div>
		}
		else
		{
			<span></span>
		}
	</div>

</div>

