feat(24-02): add auth prompt state, modal, usePublicSetup hook, guard onboarding

- Extend uiStore with showAuthPrompt/openAuthPrompt/closeAuthPrompt state
- Create AuthPromptModal component with sign in/sign up CTAs pointing to /login
- Add usePublicSetup hook to useSetups for anonymous setup viewing via public API
- Rework useOnboardingComplete to accept enabled param (guards auth-gated call)
This commit is contained in:
2026-04-10 10:06:59 +02:00
parent afab8175f9
commit cd85715d05
4 changed files with 81 additions and 2 deletions

View File

@@ -64,6 +64,16 @@ export function useSetup(setupId: number | null) {
});
}
export function usePublicSetup(setupId: number | null) {
return useQuery({
queryKey: ["setups", setupId, "public"],
queryFn: () => apiGet<SetupWithItems>(`/api/setups/${setupId}/public`),
enabled: setupId != null,
retry: (count, error) =>
error instanceof ApiError && error.status === 404 ? false : count < 3,
});
}
export function useCreateSetup() {
const queryClient = useQueryClient();
return useMutation({