import { useState } from 'react' import { usePWAInstall } from '@/hooks/usePWAInstall' import { usePlatform } from '@/hooks/usePlatform' import { CloseIcon, ShareIcon, PlusCircleIcon } from '@/components/icons' export function InstallPrompt() { const { canInstall, canInstallIOS, promptInstall, dismissInstall, isStandalone } = usePWAInstall() const { isTelegram, haptic } = usePlatform() const [showIOSGuide, setShowIOSGuide] = useState(false) if (isTelegram || isStandalone) { return null } // iOS Safari install guide if (canInstallIOS) { if (showIOSGuide) { return (

Install Hapi

1

Tap the Share button in the toolbar

2

Scroll down and tap Add to Home Screen

3

Tap Add in the top right corner

) } return (

Install Hapi

Add to home screen for the best experience

) } // Chrome/Edge install prompt if (!canInstall) { return null } const handleInstall = async () => { haptic.impact('light') const success = await promptInstall() if (success) { haptic.notification('success') } } return (

Install Hapi

Add to home screen for the best experience

) }