added habits to work in db

This commit is contained in:
masongga
2026-05-23 19:46:33 -06:00
parent 9641b120e4
commit 1ce4d0d68f
4 changed files with 358 additions and 135 deletions

View File

@@ -60,6 +60,14 @@ export function getCatalogEntry(habitId: string) {
return habitCatalog.find((habit) => habit.id === habitId);
}
export function getCatalogIdByLabel(label: string) {
return habitCatalog.find((habit) => habit.label === label)?.id ?? null;
}
export function isCatalogLabel(label: string) {
return habitCatalog.some((habit) => habit.label === label);
}
export function matchesFocusTopics(
entry: HabitCatalogEntry,
preferences: ProfilePreferences,