diff --git a/docs/project-structure.txt b/docs/project-structure.txt index e51b473..0abd7e9 100644 --- a/docs/project-structure.txt +++ b/docs/project-structure.txt @@ -125,6 +125,7 @@ Mana-Loop/ │ │ │ │ │ ├── golemancy-utils.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── AchievementsTab.tsx +│ │ │ │ ├── ActivityLog.tsx │ │ │ │ ├── AttunementsTab.test.ts │ │ │ │ ├── AttunementsTab.tsx │ │ │ │ ├── CraftingTab.test.ts diff --git a/src/components/game/tabs/ActivityLog.tsx b/src/components/game/tabs/ActivityLog.tsx new file mode 100644 index 0000000..c9b4eac --- /dev/null +++ b/src/components/game/tabs/ActivityLog.tsx @@ -0,0 +1,40 @@ +'use client'; + +import type { ActivityLogEntry } from '@/lib/game/types'; +import { ScrollArea } from '@/components/ui/scroll-area'; +import { DebugName } from '@/components/game/debug/debug-context'; + +interface ActivityLogProps { + activityLog: ActivityLogEntry[]; + maxEntries?: number; +} + +export function ActivityLog({ activityLog, maxEntries = 30 }: ActivityLogProps) { + const entries = activityLog.slice(0, maxEntries); + + return ( + + + {entries.length === 0 ? ( +
No activity yet.
+ ) : ( +
+ {entries.map((entry) => ( +
+ + [{entry.eventType}] + + {entry.message} +
+ ))} +
+ )} +
+
+ ); +} + +ActivityLog.displayName = 'ActivityLog';