Some items require items which also have their own recipes. Let's add the ability to break down a material into its own materials.
For UX, grey out the name of the broken down item, and add it's mats to the material list. Switch "break down" button with "undo" button.
This will also need a recipe selection menu for the items with more than one, when breaking down. The "break down" button can be an inline dropdown menu if more than one, otherwise make it just clickable text.
For the backend, we can just add an array of broken down items, and when building the materials object just expand out broken down items into their own recipes.
Some items require items which also have their own recipes. Let's add the ability to break down a material into its own materials. For UX, grey out the name of the broken down item, and add it's mats to the material list. Switch "break down" button with "undo" button. This will also need a recipe selection menu for the items with more than one, when breaking down. The "break down" button can be an inline dropdown menu if more than one, otherwise make it just clickable text.
For the backend, we can just add an array of broken down items, and when building the materials object just expand out broken down items into their own recipes.