diff --git a/frontend/src/components/recipes/IngredientGroupDisplayListItem.tsx b/frontend/src/components/recipes/IngredientGroupDisplayListItem.tsx
new file mode 100644
index 0000000..a2d4677
--- /dev/null
+++ b/frontend/src/components/recipes/IngredientGroupDisplayListItem.tsx
@@ -0,0 +1,22 @@
+import type {IngredientGroupModel} from "../../models/IngredientGroupModel.ts";
+
+type IngredientGroupDisplayListItemProps = {
+ groupModel: IngredientGroupModel,
+ index: number,
+}
+
+export default function IngredientGroupDisplayListItem({groupModel, index}: IngredientGroupDisplayListItemProps) {
+ return (
+ {/* the title is optional, only print if present */}
+ {groupModel.title && groupModel.title.trim() !== "" && (
+
{groupModel.title}
+ )}
+
+ {groupModel.ingredientList.map((ing, j) => (
+ -
+ {ing.amount ?? ""} {ing.unit ?? ""} {ing.name}
+
+ ))}
+
+
);
+}
\ No newline at end of file
diff --git a/frontend/src/components/recipes/IngredientGroupListItem.tsx b/frontend/src/components/recipes/IngredientGroupEditorListItem.tsx
similarity index 81%
rename from frontend/src/components/recipes/IngredientGroupListItem.tsx
rename to frontend/src/components/recipes/IngredientGroupEditorListItem.tsx
index 8a7a1cd..56133a2 100644
--- a/frontend/src/components/recipes/IngredientGroupListItem.tsx
+++ b/frontend/src/components/recipes/IngredientGroupEditorListItem.tsx
@@ -5,7 +5,7 @@ import type {IngredientGroupModel} from "../../models/IngredientGroupModel.ts";
import type {IngredientModel} from "../../models/IngredientModel.ts";
import HorizontalInputGroupLayout from "../basics/HorizontalInputGroupLayout.tsx";
-type IngredientGroupListItemProps = {
+type IngredientGroupEditorListItemProps = {
/** The list item's index */
index: number
/** Model containing data for ingredient group */
@@ -23,12 +23,12 @@ type IngredientGroupListItemProps = {
* @param handleUpdate Model containing data for ingredient group
* @param handleRemove Method for removing group
*/
-export default function IngredientGroupListItem({
- index,
- ingredientGroupModel,
- handleUpdate,
- handleRemove
- }: IngredientGroupListItemProps) {
+export default function IngredientGroupEditorListItem({
+ index,
+ ingredientGroupModel,
+ handleUpdate,
+ handleRemove
+ }: IngredientGroupEditorListItemProps) {
const updateIngredientList = (index: number, ingredientList: IngredientModel[]) => {
handleUpdate(index, "ingredientList", ingredientList)
}
diff --git a/frontend/src/components/recipes/IngredientGroupListEditor.tsx b/frontend/src/components/recipes/IngredientGroupListEditor.tsx
index 891a643..ddbfb06 100644
--- a/frontend/src/components/recipes/IngredientGroupListEditor.tsx
+++ b/frontend/src/components/recipes/IngredientGroupListEditor.tsx
@@ -3,7 +3,7 @@ import type {IngredientGroupModel} from "../../models/IngredientGroupModel"
import Button from "../basics/Button"
import {Plus} from "lucide-react"
import {ButtonType} from "../basics/BasicButtonDefinitions"
-import IngredientGroupListItem from "./IngredientGroupListItem.tsx";
+import IngredientGroupEditorListItem from "./IngredientGroupEditorListItem.tsx";
type IngredientGroupListEditorProps = {
ingredientGroupList: IngredientGroupModel[]
@@ -48,7 +48,7 @@ export function IngredientGroupListEditor({ingredientGroupList, onChange}: Ingre
Zutaten
{ingredientGroupList.map((ingGrp, index) => (
-
void;
};
-export function InstructionStepDesktopListItem({
- id,
- index,
- step,
- onUpdate,
- onRemove,
- }: InstructionStepDesktopListItemProps) {
+export function InstructionStepEditorDesktopListItem({
+ id,
+ index,
+ step,
+ onUpdate,
+ onRemove,
+ }: InstructionStepEditorDesktopListItemProps) {
const {attributes, listeners, setNodeRef, transform, transition} = useSortable({id});
const style = {transform: CSS.Transform.toString(transform), transition};
diff --git a/frontend/src/components/recipes/InstructionStepMobileListItem.tsx b/frontend/src/components/recipes/InstructionStepEditorMobileListItem.tsx
similarity index 85%
rename from frontend/src/components/recipes/InstructionStepMobileListItem.tsx
rename to frontend/src/components/recipes/InstructionStepEditorMobileListItem.tsx
index f28ee9f..9c2be01 100644
--- a/frontend/src/components/recipes/InstructionStepMobileListItem.tsx
+++ b/frontend/src/components/recipes/InstructionStepEditorMobileListItem.tsx
@@ -5,7 +5,7 @@ import type {InstructionStepModel} from "../../models/InstructionStepModel.ts";
import {MoveButtonControl} from "../basics/MoveButtonControl.tsx";
import {NumberCircle} from "../basics/NumberCircle.tsx";
-type InstructionStepMobileListItemProps = {
+type InstructionStepEditorMobileListItemProps = {
/** Index of the instruction step */
index: number;
/** Model holding the instruction step data, e.g., instruction text */
@@ -46,15 +46,15 @@ type InstructionStepMobileListItemProps = {
* @param isFirst Indicates whether this is the first instruction step. In this case, the step cannot be moved up.
* @param isLast Indicates whether this is the last instruction step. In this case, the step cannot be moved down.
*/
-export function InstructionStepMobileListItem({
- index,
- stepModel,
- onMove,
- onUpdate,
- onRemove,
- isFirst,
- isLast
- }: InstructionStepMobileListItemProps) {
+export function InstructionStepEditorMobileListItem({
+ index,
+ stepModel,
+ onMove,
+ onUpdate,
+ onRemove,
+ isFirst,
+ isLast
+ }: InstructionStepEditorMobileListItemProps) {
return (
{instructionStepList.map((step, index) => (
-
{instructionStepList.map((step, index) => (
- Zutaten