This is a single-page React + Vite app for the Maple Street Library team. The UI
is wired up to helper functions that you will implement.
π¨βπΌ We need this dashboard to show accurate library activity. Your task is to
complete the helper utilities so the catalog, rooms, events, and member activity
sections all populate with real data.
Your assignment
- β implement the utilities for the dashboard
- β review the live dataset
- β confirm the UI renders accurate results
Required exports (already named in practice.ts)
Implement each function to match these observable behaviors against
library-data.ts:getCheckedOutBooks(books)β books that have acheckedOutByMemberIdgetAvailableBooks(books)β books that do not have acheckedOutByMemberIdgetUniqueTags(books)β aSet<string>of every tag across all booksgetTagCounts(books)β{ [tag]: count }for every tag occurrencegetMemberLookup(members)β{ [memberId]: member }getBooksByMemberId(books)β aMap<memberId, Book[]>of checked-out books grouped by the borrowing member (skip books that are not checked out)getEventList(eventsById)β an array of all events fromeventsByIdgetEventSummaries(eventsById)β an array of{ id, name }for each eventgetRoomList(roomsById)β an array of all rooms fromroomsByIdaddBook(books, newBook)β a new array withnewBookappended; do not mutate the input arraymergeTags(...tagLists)β one unique string array (first-seen order is fine)summarizeLibrary(library)β{ totalBooks, totalMembers, totalEvents, checkedOut }where each field reflects the library's books, members, events, and checked-out book countformatMember({ name, email })β the member's name alone when there is no email, otherwise the name with the email in parentheses
Until helpers are implemented, the UI intentionally shows empty/loading states
(including a "Member labels are still loading." message while
formatMember
returns an empty string). You'll know you're done when those placeholders
disappear and the snapshot counts match the dataset.

