@page "/admin/npcs/shops/edit" @model Npcs.ShopEditModel @using System.Text.Json @{ ViewData["Title"] = Model.IsNew ? "Create NPC Shop" : $"Edit Shop: {Model.Shop.Name}"; var itemCatalog = JsonSerializer.Serialize(Model.ItemDefinitions.Select(i => new { id = i.Id, name = i.Name, rarity = i.Rarity.ToString(), type = i.Type.ToString(), search = ($"{i.Name} {i.Rarity} {i.Type} {i.Id}").ToLowerInvariant() })); }

@(Model.IsNew ? "Create NPC Shop" : "Edit NPC Shop")

@(Model.IsNew ? "Create a slot-based shop inventory" : $"ID: {Model.Shop.Id}")

@if (!string.IsNullOrEmpty(Model.Message)) {
@Model.Message
}
@Html.AntiForgeryToken()
Back
@if (!Model.IsNew) {

Shop Slots (@Model.Items.Count)

@foreach (var i in Model.Items) { } @if (!Model.Items.Any()) { }
Slot Item Qty Price Restock Interval Actions
@i.SlotIndex
@i.ItemDefinition?.Name
ID: @i.ItemDefinitionId
@i.Quantity @i.PriceGold @(i.Restocks ? "Yes" : "No") @i.RestockIntervalSeconds s
@Html.AntiForgeryToken()
No slot items yet.
}
@section Scripts { }