import React from "react"; import { useNavigate } from "react-router"; import Container from "src/components/Container"; import { Button } from "src/components/ui/button"; import { localStorageKeys } from "src/constants"; import { useInfo } from "src/hooks/useInfo"; export function Welcome() { const { data: info } = useInfo(); const navigate = useNavigate(); React.useEffect(() => { if (!info?.setupCompleted) { return; } navigate("/"); }, [info, navigate]); function navigateToAuthPage(returnTo: string) { if (info?.albyAccountConnected) { // in case user goes back after authenticating in setup // we don't want to show the auth screen twice navigate(returnTo); return; } window.localStorage.setItem(localStorageKeys.setupReturnTo, returnTo); // by default, allow the user to choose whether or not to connect to alby account let navigateTo = "/setup/alby"; if (info?.oauthRedirect) { // if using a custom OAuth client (e.g. Alby Cloud) the user must connect their Alby account // but they are already logged in at getalby.com, so it should be an instant redirect. navigateTo = "/alby/auth"; } navigate(navigateTo); } return ( Welcome ยท Alby Hub

Welcome to Alby Hub

A powerful, all-in-one bitcoin lightning wallet with the superpower of connecting to applications.

{info?.enableAdvancedSetup && ( )}
); }