import { useEffect, useState } from "react"; import { invoke } from "@tauri-apps/api/core"; import { useStore } from "./store"; import TitleBar from "./components/TitleBar"; import Sidebar from "./components/Sidebar"; import HomeView from "./components/HomeView"; import GuideView from "./components/GuideView"; import ProfileModal from "./components/ProfileModal"; import SyncOverlay from "./components/SyncOverlay"; export default function App() { const { loadProfiles, loadGuides, view, syncing, syncGuides } = useStore(); const [showProfileModal, setShowProfileModal] = useState(false); const [needsSync, setNeedsSync] = useState(false); useEffect(() => { async function init() { await loadProfiles(); const has = await invoke("has_guides"); if (!has) { setNeedsSync(true); } else { await loadGuides(); } } init(); }, []); async function handleInitialSync() { setNeedsSync(false); await syncGuides(); } return (
setShowProfileModal(true)} />
{view === "home" ? : }
{showProfileModal && setShowProfileModal(false)} />} {syncing && } {needsSync && (
⚔️

Bienvenue dans TougliGui

Première utilisation — synchronisation du guide Tougli depuis Google Sheets.
Cela peut prendre quelques secondes.

)}
); }