import * as Clipboard from "expo-clipboard"; import { Link, router } from "expo-router"; import { Pressable, View } from "react-native"; import { Text } from "@/components/fixed-text"; import { haptics } from "@/lib/haptics"; import { MOBILE_LOCALE_OPTIONS, useLocale } from "@/lib/locale"; import { colors } from "@/theme/colors"; import { mono, radius, type } from "@/theme/type"; import { Button } from "./button"; import { Icon } from "./icon"; import { EmptyState, LoadingState } from "./state-views"; import { useAccount } from "@/lib/account"; import { useConnectionRecovering } from "@/lib/client"; import { listComputers, retryComputerDiscovery, useComputerDiscovery, useComputers } from "@/lib/computers"; const SETUP = "npm i -g linkshell-cli\nlinkshell host --daemon"; const DESKTOP_INSTALL = "https://liutianjie.github.io/LinkShell/#install"; /** Onboarding only after the account's computer list has finished restoring. */ export function Welcome() { const { locale, preference, setPreference, t } = useLocale(); const discovery = useComputerDiscovery(); const recovering = useConnectionRecovering(); const account = useAccount((state) => state.session); const discovered = useComputers((state) => listComputers(state).length > 0); if (discovered || discovery === "loading" || (discovery === "failed" && recovering)) { return ; } if (discovery === "failed" || discovery === "refused") { return (