@using HardwareShopContracts.ViewModels
@{
    ViewData["Title"] = "Комплектующие";
	Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
}

<div class="text-center">
	<h1 class="display-4">Комплектующие</h1>
</div>


<div class="text-center">
	<p>
		<a asp-action="CreateComponent" class="btn btn-primary mx-2">Создать комплектующее</a>
		<button type="button" class="btn btn-primary mx-2" data-bs-toggle="modal" data-bs-target="#exampleModal">Изменить комплектующее</button>
		<button type="button" class="btn btn-primary mx-2">Удалить комплектующее</button>
		<a asp-action="LinkBuilds" class="btn btn-primary mx-2">Привязка сборок</a>
    </p>
	<table class="table">
		<thead>
			<tr>
				<th>
					Название
				</th>
				<th>
					Цена
				</th>
			</tr>
		</thead>
		<tbody>
		</tbody>
	</table>
</div>

<form method="post" class="d-flex flex-column align-items-center">
	<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<h5 class="modal-title" id="exampleModalLabel">Изменение комплектующего</h5>
					<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
				</div>
				<div class="modal-body">
					<div class="col">
						<label class="form-label">Название</label>
						<input type="text" class="form-control" name="email">
					</div>
					<div class="col">
						<label class="form-label">Стоимость</label>
						<input type="number" step="0.01" class="form-control" name="cost" min="0.01">
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
					<button type="submit" class="btn btn-primary">Сохранить</button>
				</div>
			</div>
		</div>
	</div>
</form>