import { useState, useEffect, lazy, Suspense } from "react"; import { openUrl } from "@tauri-apps/plugin-opener"; import { Sidebar } from "./components/sidebar/Sidebar"; import { Feed } from "./components/feed/Feed"; import { OnboardingFlow } from "./components/onboarding/OnboardingFlow"; import { PodcastPlayerBar } from "./components/podcast/PodcastPlayerBar"; import { ToastContainer } from "./components/shared/ToastContainer"; // Lazy-loaded views — only fetched when navigated to const SearchView = lazy(() => import("./components/search/SearchView").then(m => ({ default: m.SearchView }))); const RelaysView = lazy(() => import("./components/shared/RelaysView").then(m => ({ default: m.RelaysView }))); const SettingsView = lazy(() => import("./components/shared/SettingsView").then(m => ({ default: m.SettingsView }))); const ProfileView = lazy(() => import("./components/profile/ProfileView").then(m => ({ default: m.ProfileView }))); const ThreadView = lazy(() => import("./components/thread/ThreadView").then(m => ({ default: m.ThreadView }))); const ArticleEditor = lazy(() => import("./components/article/ArticleEditor").then(m => ({ default: m.ArticleEditor }))); const ArticleView = lazy(() => import("./components/article/ArticleView").then(m => ({ default: m.ArticleView }))); const ArticleFeed = lazy(() => import("./components/article/ArticleFeed").then(m => ({ default: m.ArticleFeed }))); const MediaFeed = lazy(() => import("./components/media/MediaFeed").then(m => ({ default: m.MediaFeed }))); const AboutView = lazy(() => import("./components/shared/AboutView").then(m => ({ default: m.AboutView }))); const ZapHistoryView = lazy(() => import("./components/zap/ZapHistoryView").then(m => ({ default: m.ZapHistoryView }))); const DMView = lazy(() => import("./components/dm/DMView").then(m => ({ default: m.DMView }))); const NotificationsView = lazy(() => import("./components/notifications/NotificationsView").then(m => ({ default: m.NotificationsView }))); const BookmarkView = lazy(() => import("./components/bookmark/BookmarkView").then(m => ({ default: m.BookmarkView }))); const HashtagFeed = lazy(() => import("./components/feed/HashtagFeed").then(m => ({ default: m.HashtagFeed }))); const PodcastsView = lazy(() => import("./components/podcast/PodcastsView").then(m => ({ default: m.PodcastsView }))); const FollowsView = lazy(() => import("./components/follows/FollowsView").then(m => ({ default: m.FollowsView }))); const V4VView = lazy(() => import("./components/v4v/V4VView").then(m => ({ default: m.V4VView }))); const DebugPanel = lazy(() => import("./components/shared/DebugPanel").then(m => ({ default: m.DebugPanel }))); const HelpModal = lazy(() => import("./components/shared/HelpModal").then(m => ({ default: m.HelpModal }))); import { useUIStore } from "./stores/ui"; import { useUserStore } from "./stores/user"; import { getTheme, applyTheme } from "./lib/themes"; import { useUpdater } from "./hooks/useUpdater"; import { useKeyboardShortcuts } from "./hooks/useKeyboardShortcuts"; function UpdateBanner() { const { available, version, installing, error, install, dismiss } = useUpdater(); if (!available) return null; return (