| 1 | import { useAtomValue } from "@effect/atom-react"; |
| 2 | import { AsyncResult } from "effect/reactivity"; |
| 3 | |
| 4 | import { mobilePreferencesAtom } from "./preferences"; |
| 5 | import { |
| 6 | DEFAULT_MOBILE_PROJECT_GROUPING_SETTINGS, |
| 7 | resolveMobileProjectGroupingSettings, |
| 8 | } from "./project-grouping.logic"; |
| 9 | |
| 10 | export * from "./project-grouping.logic"; |
| 11 | |
| 12 | export function useMobileProjectGroupingSettings() { |
| 13 | const preferencesResult = useAtomValue(mobilePreferencesAtom); |
| 14 | return AsyncResult.isSuccess(preferencesResult) |
| 15 | ? resolveMobileProjectGroupingSettings(preferencesResult.value) |
| 16 | : DEFAULT_MOBILE_PROJECT_GROUPING_SETTINGS; |
| 17 | } |