import { BloomOne } from '@sd/assets/images'; import clsx from 'clsx'; import { useEffect } from 'react'; import { Navigate, Outlet, useNavigate } from 'react-router'; import { currentLibraryCache, getOnboardingStore, useCachedLibraries, useDebugState } from '@sd/client'; import { tw } from '@sd/ui'; import DragRegion from '~/components/DragRegion'; import { useOperatingSystem } from '~/hooks/useOperatingSystem'; import DebugPopover from '../$libraryId/Layout/Sidebar/DebugPopover'; import { macOnly } from '../$libraryId/Layout/Sidebar/helpers'; import Progress from './Progress'; export const OnboardingContainer = tw.div`flex flex-col items-center`; export const OnboardingTitle = tw.h2`mb-2 text-3xl font-bold`; export const OnboardingDescription = tw.p`max-w-xl text-center text-ink-dull`; export const OnboardingImg = tw.img`w-20 h-20 mb-2`; export const Component = () => { const os = useOperatingSystem(); const debugState = useDebugState(); const navigate = useNavigate(); const libraries = useCachedLibraries(); const library = libraries.data?.find((l) => l.uuid === currentLibraryCache.id) || libraries.data?.[0]; useEffect( () => { const obStore = getOnboardingStore(); // This is neat because restores the last active screen, but only if it is not the starting screen // Ignoring if people navigate back to the start if progress has been made if (obStore.unlockedScreens.length > 1 && !library) { navigate(`/onboarding/${obStore.lastActiveScreen}`, { replace: true }); } }, // eslint-disable-next-line react-hooks/exhaustive-deps [] ); if (libraries.isLoading) return null; if (library?.uuid) return ; return (

© 2022 Spacedrive Technology Inc.

{/* */}
{debugState.enabled && }
); };