export default defineNuxtPlugin(() => {
  const { init } = usePWA();

  // Initialize PWA functionality when the app starts
  if (process.client) {
    init();
    
    // Register service worker update handler
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker.addEventListener('controllerchange', () => {
        console.log('PWA updated successfully');
        // You could show a toast notification here
      });
    }
  }
});
