feat: implement PWA, manifest, service worker and offline indicator

This commit is contained in:
2025-12-17 23:15:51 +01:00
parent 5807d949ef
commit 19689ffd2f
71 changed files with 1573 additions and 112 deletions

View File

@@ -0,0 +1,22 @@
'use client';
import { useEffect } from 'react';
export default function PWARegistration() {
useEffect(() => {
if ('serviceWorker' in navigator && window.location.hostname !== 'localhost') {
window.addEventListener('load', () => {
navigator.serviceWorker
.register('/sw.js')
.then((registration) => {
console.log('SW registered: ', registration);
})
.catch((registrationError) => {
console.log('SW registration failed: ', registrationError);
});
});
}
}, []);
return null;
}