diff --git a/frontend/src/components/ItemRow.tsx b/frontend/src/components/ItemRow.tsx index 7e741be..ec6e5eb 100644 --- a/frontend/src/components/ItemRow.tsx +++ b/frontend/src/components/ItemRow.tsx @@ -7,7 +7,7 @@ interface ItemRowProps { onUpdateName: (id: string, name: string) => void; onDeleteTag: (itemId: string, tagId: string) => void; onAddTag: (itemId: string, tagId: string) => void; - onDeleteItem: (itemId: string) => void; // <--- NEU + onDeleteItem: (itemId: string) => void; } export default function ItemRow({ @@ -16,7 +16,7 @@ export default function ItemRow({ onUpdateName, onDeleteTag, onAddTag, - onDeleteItem, // <--- NEU + onDeleteItem, }: ItemRowProps) { const [isEditing, setIsEditing] = useState(false); const [editName, setEditName] = useState(item.name); @@ -37,6 +37,18 @@ export default function ItemRow({ setIsEditing(false); } + // --- Dim category part if "/" exists --- + function renderNameWithCategory(name: string) { + if (!name.includes("/")) return name; + const [cat, rest] = name.split("/", 2); + return ( + <> + {cat}/ + {rest} + > + ); + } + return (