import SectionShell from "../components/SectionShell"; import { WindowsLogo, AppleLogo, LinuxLogo, DownloadSimple, type Icon } from "@phosphor-icons/react"; import { useLang } from "../i18n"; const icons: Record = { windows: WindowsLogo, macos: AppleLogo, linux: LinuxLogo, }; const VERSION = "0.8.0"; const GITHUB = "https://github.com/billowliu2/KimiSwitch"; const MIRROR_RELEASES = "https://git.codingplan.site/admin/KimiCodeSwitch/releases"; const dl = (file: string) => `${GITHUB}/releases/download/v${VERSION}/${file}`; /** Per-platform download assets for the current release (names match the CI * release workflow exactly — verified against the published v0.7.12 assets: * tauri-bundler on CI produces `Kimi.Switch_…` (dots) on every platform, * except the rpm which uses `Kimi.Switch--1` (hyphens). * Filenames interpolate VERSION, so a release bump only changes the * constant above. */ const assets: Record = { windows: [ { label: "MSI", href: dl(`Kimi.Switch_${VERSION}_x64_en-US.msi`) }, { label: "镜像", href: MIRROR_RELEASES }, ], macos: [ { label: "Apple Silicon (.dmg)", href: dl(`Kimi.Switch_${VERSION}_aarch64.dmg`) }, { label: "安装脚本", href: dl("install-macos.sh") }, ], linux: [ { label: ".deb", href: dl(`Kimi.Switch_${VERSION}_amd64.deb`) }, { label: ".AppImage", href: dl(`Kimi.Switch_${VERSION}_amd64.AppImage`) }, { label: ".rpm", href: dl(`Kimi.Switch-${VERSION}-1.x86_64.rpm`) }, ], }; export default function Download() { const { t } = useLang(); return ( {/* 不对称:Windows 为主推平台,横跨整行;macOS / Linux 两列在下方 */}
{t.download.items.map((p) => { const Icon = icons[p.id] ?? WindowsLogo; const links = assets[p.id] ?? []; const featured = p.id === "windows"; return (

{p.name}

{t.download.ready}

{p.note}

{links.map((l) => ( {l.label} ))}
); })}

{t.download.autoUpdate}

); }