From 1cfaf7080383ac372310cb1895a1b5a1bcd56ac3 Mon Sep 17 00:00:00 2001 From: Felix Zett Date: Sun, 31 Aug 2025 22:30:48 +0200 Subject: [PATCH] feat: add mandatory tag support to frontend and update ItemsPage to display mandatory tags --- frontend/src/api.ts | 1 + frontend/src/pages/ItemsPage.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/api.ts b/frontend/src/api.ts index 219aaa6..3c90876 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -1,6 +1,7 @@ export interface Tag { id: string; name: string; + mandatory: boolean; } export interface Item { diff --git a/frontend/src/pages/ItemsPage.tsx b/frontend/src/pages/ItemsPage.tsx index 994509b..c8fcfbf 100644 --- a/frontend/src/pages/ItemsPage.tsx +++ b/frontend/src/pages/ItemsPage.tsx @@ -151,11 +151,16 @@ export default function ItemsPage() { "bg-gray-200 text-sm rounded px-1 py-0.5 flex items-center cursor-pointer " + (newItemTags.includes(tag.id) ? "bg-blue-200 text-blue-900 font-bold" - : "") + : "") + + (tag.mandatory ? " border-2 border-yellow-400" : "") } onClick={() => toggleNewItemTag(tag.id)} + title={tag.mandatory ? "Pflicht-Tag (mandatory)" : ""} > #{tag.name} + {tag.mandatory && ( + * + )} ))}