import { useEffect } from 'react' import useInstallPromptStore, { APK_URL, canOfferApp } from '../store/installPromptStore' import { useTranslation } from '@xenia/i18n' const BENEFITS = [ { icon: '⚡', title: 'install.fast', text: 'install.fastText' }, { icon: '📶', title: 'install.wifi', text: 'install.wifiText' }, { icon: '🔒', title: 'install.secure', text: 'install.secureText' }, { icon: '🔄', title: 'install.noSetup', text: 'install.noSetupText' }, ] const STEPS = [ 'install.step1', 'install.step2', 'install.step3', ] /** * Dialog offering the Android app to browser users (see installPromptStore). * Opens by itself once; afterwards from the side drawer. */ export default function InstallAppDialog() { const { t } = useTranslation('waiter') const { open, dismiss, autoOpen } = useInstallPromptStore() useEffect(() => { if (canOfferApp()) autoOpen() }, [autoOpen]) if (!open) return null return (
e.stopPropagation()} style={{ width: '100%', maxWidth: 360, maxHeight: '92vh', overflowY: 'auto', background: 'var(--bg2)', border: '1px solid var(--border)', borderRadius: 22, boxShadow: '0 16px 48px rgb(var(--x-scrim-rgb) / 0.5)', padding: '26px 22px 20px', display: 'flex', flexDirection: 'column', gap: 18, }} >

{t('install.title')}

{t('install.intro')}

{BENEFITS.map(b => (
{b.icon}
{t(b.title)}
{t(b.text)}
))}
    {STEPS.map(s =>
  1. {t(s)}
  2. )}
{t('install.download')}
) }