| 1 | import { dismissOnboarding } from "../lib/onboarding"; |
| 2 | import { useCommittedCommand } from "../lib/useCommittedCommand"; |
| 3 | import { useOverlayStore } from "../store/overlays"; |
| 4 | import { useAppNavigationStore } from "../store/appNavigation"; |
| 5 | |
| 6 | export function useOnboardingCommands(providerConfigured: () => void) { |
| 7 | const completeOnboarding = useCommittedCommand(() => { |
| 8 | providerConfigured(); |
| 9 | useOverlayStore.getState().setNeedsOnboarding(false); |
| 10 | }); |
| 11 | const chooseOnboardingProvider = useCommittedCommand(() => { |
| 12 | const overlays = useOverlayStore.getState(); |
| 13 | overlays.setNeedsOnboarding(false); |
| 14 | const navigation = useAppNavigationStore.getState(); |
| 15 | navigation.setSettingsFocus({ target: "model-access", onboarding: true }); |
| 16 | navigation.setSettingsTarget("providers"); |
| 17 | }); |
| 18 | const skipOnboarding = useCommittedCommand(() => { |
| 19 | dismissOnboarding(); |
| 20 | useOverlayStore.getState().setNeedsOnboarding(false); |
| 21 | }); |
| 22 | return { completeOnboarding, chooseOnboardingProvider, skipOnboarding }; |
| 23 | } |
| 24 |