'use client'; import { useEffect, useState } from 'react'; import { useLocale, useTranslations } from 'next-intl'; import { desktopDownloadUrl, type DesktopFileInfo, type DesktopLatestInfo, formatFileSize, loadDesktopLatest } from '@/lib/desktop'; const BUTTON_CLASS = 'inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground hover:opacity-90'; function WindowsIcon() { return ( ); } function LinuxIcon() { return ( ); } function DownloadButton({ file, label, icon, testId, locale, fileInfoText, }: { file: DesktopFileInfo; label: string; icon: React.ReactNode; testId: string; locale: string; fileInfoText: (values: { name: string; size: string }) => string; }) { return (
{fileInfoText({ name: file.name, size: formatFileSize(file.size, locale) })}
{t('desktop.intro')}
{t('desktop.firstStart')}
{t('desktop.tray')}
{t('desktop.update')}
{info === null &&{t('desktop.unavailable')}
} {info && ( <>{t('desktop.versionLabel', { version: info.version })}
{info.channel === 'beta' && ({t('desktop.channelBeta', { commit: info.commit })}
)}