+
+ @if (Item != null)
+ {
+ //
)
+ @Item.DisplayName
+ }
+
\ No newline at end of file
diff --git a/BlazorApp1/Components/InventoryItem.razor.cs b/BlazorApp1/Components/InventoryItem.razor.cs
new file mode 100644
index 0000000..9116c0d
--- /dev/null
+++ b/BlazorApp1/Components/InventoryItem.razor.cs
@@ -0,0 +1,62 @@
+using Microsoft.AspNetCore.Components;
+
+namespace BlazorApp1.Components
+{
+ public partial class InventoryItem
+ {
+ [Parameter]
+ public int Index { get; set; }
+
+ [Parameter]
+ public Item Item { get; set; }
+
+ [Parameter]
+ public bool NoDrop { get; set; }
+
+ [CascadingParameter]
+ public Crafting Parent { get; set; }
+
+ internal void OnDragEnter()
+ {
+ if (NoDrop)
+ {
+ return;
+ }
+
+ Parent.Actions.Add(new CraftingAction { Action = "Drag Enter", Item = this.Item, Index = this.Index });
+ }
+
+ internal void OnDragLeave()
+ {
+ if (NoDrop)
+ {
+ return;
+ }
+
+ Parent.Actions.Add(new CraftingAction { Action = "Drag Leave", Item = this.Item, Index = this.Index });
+ }
+
+ internal void OnDrop()
+ {
+ if (NoDrop)
+ {
+ return;
+ }
+
+ this.Item = Parent.CurrentDragItem;
+ Parent.RecipeItems[this.Index] = this.Item;
+
+ Parent.Actions.Add(new CraftingAction { Action = "Drop", Item = this.Item, Index = this.Index });
+
+ // Check recipe
+ Parent.CheckRecipe();
+ }
+
+ private void OnDragStart()
+ {
+ Parent.CurrentDragItem = this.Item;
+
+ Parent.Actions.Add(new CraftingAction { Action = "Drag Start", Item = this.Item, Index = this.Index });
+ }
+ }
+}
diff --git a/BlazorApp1/Components/InventoryItem.razor.css b/BlazorApp1/Components/InventoryItem.razor.css
new file mode 100644
index 0000000..d6f5ec3
--- /dev/null
+++ b/BlazorApp1/Components/InventoryItem.razor.css
@@ -0,0 +1,6 @@
+.item {
+ width: 64px;
+ height: 64px;
+ border: 1px solid;
+ overflow: hidden;
+}
diff --git a/BlazorApp1/Pages/List.razor.cs b/BlazorApp1/Pages/List.razor.cs
index 3b27a7a..f7c9b32 100644
--- a/BlazorApp1/Pages/List.razor.cs
+++ b/BlazorApp1/Pages/List.razor.cs
@@ -14,7 +14,7 @@ namespace BlazorApp1.Pages
[Inject]
public IStringLocalizer