feat: show list name on header

This commit is contained in:
Jose Selesan
2026-10-19 12:46:40 -03:00
parent c374db1616
commit bba10361f0
6 changed files with 79 additions and 52 deletions

View File

@@ -13,6 +13,11 @@ export function useLists() {
return useQuery(listsQueryOptions())
}
/** The list a user lands on: their primary one, falling back to the first. */
export function pickPrimaryList(lists: ShoppingListSummary[]): ShoppingListSummary | undefined {
return lists.find((list) => list.isPrimary) ?? lists[0]
}
export function useCreateList() {
const queryClient = useQueryClient()