This commit is contained in:
2026-07-19 19:45:32 +08:00
parent b68bfc6287
commit bbfc055c21
12 changed files with 910 additions and 431 deletions
+15 -8
View File
@@ -1,6 +1,7 @@
import { ChevronRight } from "lucide-react";
import { PanelShell } from "@/components/panel-shell";
import { PwaControls } from "@/components/pwa-controls";
import { PushTestPanel } from "@/components/push-test-panel";
import { getCaregiverSettingsOverview } from "@/lib/caregiver-panel";
import { requireCaregiverSession } from "@/lib/page-auth";
import { getCaregiverDisplayName } from "@/lib/session";
@@ -13,17 +14,23 @@ export default async function SettingsPage() {
const name = getCaregiverDisplayName(caregiver);
return (
<PanelShell currentPath="/settings" title="我的" caregiverLabel={name}>
<section className="card card-pad" style={{ display: "flex", alignItems: "center", gap: 12 }}>
<span className="avatar" style={{ width: 44, height: 44, fontSize: 17 }}>{name.slice(-1)}</span>
<span className="row-main"><strong style={{ display: "block", fontSize: 15 }}>{name}</strong><span className="row-meta">已绑定 {overview.deviceCount} 台设备 · {overview.pushSubscriptionCount} 台设备已开启提醒</span></span>
<PanelShell currentPath="/settings" title="我的" description="账号、通知与设备" caregiverLabel={name} caregiverId={caregiver.id}>
<section className="card settings-profile">
<span className="avatar">{name.slice(-1)}</span>
<span className="row-main">
<strong style={{ display: "block", fontSize: 15.5 }}>{name}</strong>
<span className="row-meta">已绑定 {overview.deviceCount} 台设备 · {overview.pushSubscriptionCount} 台设备已开启提醒</span>
</span>
<ChevronRight className="chevron" size={16} strokeWidth={2} />
</section>
<div className="settings-controls"><PwaControls /></div>
<div className="settings-controls"><PushTestPanel initialSubscriptionCount={overview.pushSubscriptionCount} deviceCount={overview.deviceCount} /></div>
<section>
<div className="section-title"><h2>通知与设备</h2></div>
<PwaControls deviceCount={overview.deviceCount} />
</section>
<form action="/api/account/logout" method="post" className="card">
<button type="submit" className="list-row" style={{ justifyContent: "center", color: "var(--danger)", fontWeight: 500 }}>退出登录</button>
<button type="submit" className="settings-row" style={{ justifyContent: "center", color: "var(--danger)", fontSize: 14, fontWeight: 600 }}>退出登录</button>
</form>
<p className="muted-note" style={{ textAlign: "center" }}>安智伴 · AI 数字人陪护 · 家属端 v2</p>
</PanelShell>