refactor: decompose frontend state and medication dialog flows

This commit is contained in:
Daniel Volz
2026-03-27 06:50:19 +01:00
committed by GitHub
parent b58c4fe5bb
commit f46043970f
28 changed files with 2450 additions and 1613 deletions
+18
View File
@@ -0,0 +1,18 @@
import { loadCollapsedDaysFromStorage } from "../../utils/storage";
export type ScheduleCollapseState = {
collapsed: Set<string>;
expanded: Set<string>;
};
export function loadScheduleCollapseState(collapseKey: string, expandKey: string): ScheduleCollapseState {
return loadCollapsedDaysFromStorage(collapseKey, expandKey);
}
export function saveCollapsedDaySet(storageKey: string, value: Set<string>): void {
try {
localStorage.setItem(storageKey, JSON.stringify([...value]));
} catch {
// Ignore storage failures and keep UI responsive.
}
}