2026-07-19 19:45:32 +08:00

39 lines
1.8 KiB
TypeScript

import { ChevronRight } from "lucide-react";
import { PanelShell } from "@/components/panel-shell";
import { PwaControls } from "@/components/pwa-controls";
import { getCaregiverSettingsOverview } from "@/lib/caregiver-panel";
import { requireCaregiverSession } from "@/lib/page-auth";
import { getCaregiverDisplayName } from "@/lib/session";
export const dynamic = "force-dynamic";
export default async function SettingsPage() {
const caregiver = await requireCaregiverSession("/settings");
const overview = await getCaregiverSettingsOverview(caregiver.id);
const name = getCaregiverDisplayName(caregiver);
return (
<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>
<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="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>
);
}