'use client'; import { useEffect, useState } from 'react'; export default function Shell({ title, subtitle, children }) { const [showInstall, setShowInstall] = useState(false); useEffect(() => { // 检测是否已在PWA模式,不是则提示安装 const isStandalone = window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone; if (!isStandalone) { const timer = setTimeout(() => setShowInstall(true), 3000); return () => clearTimeout(timer); } }, []); return (

LINGJING

{title}

{subtitle && (

{subtitle}

)}
{children}
{showInstall && (
setShowInstall(false)}> 📲 添加到主屏幕,获得沉浸式体验  ✕
)}
); }