'use client';

import { useEffect } from 'react';

export function ServiceWorkerRegister() {
    useEffect(() => {
        if ('serviceWorker' in navigator) {
            window.addEventListener('load', () => {
                navigator.serviceWorker.register('/sw.js').then(
                    (registration) => {
                        // Registration successful
                    })
                    .catch((err) => {
                        // Registration failed
                    });
            });
        }
    }, []);

    return null;
}
