import { Button } from "@/components/ui/button"; import { useUpdater } from "@/modules/updater"; import { GithubIcon, Globe02Icon } from "@hugeicons/core-free-icons"; import { HugeiconsIcon } from "@hugeicons/react"; import { getName, getVersion } from "@tauri-apps/api/app"; import { openUrl } from "@tauri-apps/plugin-opener"; import { arch, platform } from "@tauri-apps/plugin-os"; import { useEffect, useState } from "react"; import { SectionHeader } from "../components/SectionHeader"; const REPO_URL = "https://github.com/crynta/terax-ai"; const WEBSITE = "https://terax.app"; const PLATFORM_LABEL: Record = { macos: "macOS", windows: "Windows", linux: "Linux", ios: "iOS", android: "Android", freebsd: "FreeBSD", }; export function AboutSection() { const [version, setVersion] = useState(""); const [name, setName] = useState("Terax"); const [build, setBuild] = useState(""); const { status, check, install } = useUpdater({ autoCheck: false }); const checking = status.kind === "checking"; const downloading = status.kind === "downloading"; const available = status.kind === "available"; const ready = status.kind === "ready"; const checkLabel = status.kind === "uptodate" ? "You're up to date" : status.kind === "error" ? "Check failed — retry" : checking ? "Checking…" : downloading ? "Downloading…" : ready ? "Restart to install" : available ? `Install v${status.update.version}` : "Check for updates"; const onUpdateClick = () => { if (available) void install(); else void check({ manual: true }); }; useEffect(() => { void getVersion().then(setVersion); void getName().then(setName); try { const p = platform(); const a = arch(); const platformLabel = PLATFORM_LABEL[p] ?? p; setBuild(`${platformLabel} · ${a}`); } catch { setBuild(""); } }, []); return (
{name} Open-source AI-native terminal emulator v{version || "—"}
Build
{build ? `${build} · v${version}` : `v${version}`}
Bundle ID
app.crynta.terax
License
Apache 2.0
Source code
Website
{status.kind === "error" && (

{status.message}

)} {downloading && status.contentLength ? (

{Math.min( 100, Math.round((status.downloaded / status.contentLength) * 100), )} %

) : null}
); }