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.7.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, e.g. Kimi.Switch_0.7.0_x64_en-US.msi). */ const assets: Record = { windows: [ { label: "MSI", href: dl("Kimi.Switch_0.7.0_x64_en-US.msi") }, { label: "镜像", href: MIRROR_RELEASES }, ], macos: [ { label: "Apple Silicon (.dmg)", href: dl("Kimi.Switch_0.7.0_aarch64.dmg") }, ], linux: [ { label: ".deb", href: dl("Kimi.Switch_0.7.0_amd64.deb") }, { label: ".AppImage", href: dl("Kimi.Switch_0.7.0_amd64.AppImage") }, { label: ".rpm", href: dl("Kimi.Switch-0.7.0-1.x86_64.rpm") }, ], }; export default function Download() { const { t } = useLang(); return (
{t.download.items.map((p) => { const Icon = icons[p.id] ?? WindowsLogo; const links = assets[p.id] ?? []; return (
{t.download.ready}

{p.name}

{p.note}

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

{t.download.autoUpdate}

); }