export const usePWA = () => {
    const isInstalledAsPWA = ref(false);

    const checkPWAInstallation = () => {
        const isStandalone = window.matchMedia(
            "(display-mode: standalone)"
        ).matches;
        const isIOSPWA = (window.navigator as any).standalone;
        isInstalledAsPWA.value = isStandalone || isIOSPWA;
    };

    onMounted(() => {
        checkPWAInstallation();
    });

    return {
        isInstalledAsPWA,
    };
};
