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

69 lines
3.3 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ChevronRight, Heart, MessageCircle, MessagesSquare } from "lucide-react";
import Link from "next/link";
import { PanelShell } from "@/components/panel-shell";
import { getCaregiverMessages } from "@/lib/caregiver-panel";
import { requireFamilyWorkspace } from "@/lib/family-page";
import { requireCaregiverSession } from "@/lib/page-auth";
import { getCaregiverDisplayName } from "@/lib/session";
export const dynamic = "force-dynamic";
export default async function CompanionPage() {
const caregiver = await requireCaregiverSession("/companion");
const [workspace, messageOverview] = await Promise.all([
requireFamilyWorkspace(caregiver.id),
getCaregiverMessages(caregiver.id),
]);
return (
<PanelShell
currentPath="/companion"
title="温暖陪伴"
description="留言、回忆和每一次认真回应"
caregiverLabel={getCaregiverDisplayName(caregiver)}
unreadCount={messageOverview.unreadIncomingCount}
>
<section className="card">
<Link className="list-row feature-row" href="/messages">
<span className="feature-icon"><MessageCircle size={19} strokeWidth={1.8} /></span>
<span className="row-main">
<span className="row-title"></span>
<span className="row-meta"></span>
</span>
<span style={{ display: "flex", alignItems: "center", gap: 6 }}>
{messageOverview.unreadIncomingCount > 0 ? <span className="count-badge">{messageOverview.unreadIncomingCount}</span> : null}
<ChevronRight className="chevron" size={16} strokeWidth={2} />
</span>
</Link>
<Link className="list-row feature-row" href="/activity">
<span className="feature-icon olive"><MessagesSquare size={19} strokeWidth={1.8} /></span>
<span className="row-main">
<span className="row-title"></span>
<span className="row-meta"></span>
</span>
<ChevronRight className="chevron" size={16} strokeWidth={2} />
</Link>
<div className="list-row feature-row feature-disabled">
<span className="feature-icon muted"><Heart size={19} strokeWidth={1.8} /></span>
<span className="row-main">
<span className="row-title"></span>
<span className="row-meta"></span>
</span>
<span className="member-role">线</span>
</div>
</section>
<section>
<div className="section-title"><h2></h2></div>
<div className="stats" style={{ gridTemplateColumns: "repeat(3, 1fr)" }}>
<div className="stat accent"><strong>{workspace.posts.length}</strong><span></span></div>
<div className="stat"><strong>{workspace.memos.length}</strong><span></span></div>
<div className="stat"><strong>{messageOverview.messages.length}</strong><span></span></div>
</div>
<p className="muted-note" style={{ margin: "10px 2px 0" }}></p>
</section>
</PanelShell>
);
}