Add PWA support with manifest, service worker, and icons

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Michael Dong
2026-02-27 12:14:47 +08:00
parent 8131ec7af2
commit af194d1b9c
13 changed files with 184 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
"use client";
import { useEffect } from "react";
export function ServiceWorkerRegistrar() {
useEffect(() => {
if ("serviceWorker" in navigator && process.env.NODE_ENV === "production") {
navigator.serviceWorker.register("/sw.js").catch((err) => {
console.warn("SW registration failed:", err);
});
}
}, []);
return null;
}