import Link from "next/link"; import { BindDeviceForm } from "@/components/dashboard-actions"; import { PanelShell } from "@/components/panel-shell"; import { PwaControls } from "@/components/pwa-controls"; import { getCaregiverDevices } from "@/lib/caregiver-panel"; import { formatDateTime, getDeviceName, truncateText } from "@/lib/panel-format"; import { requireCaregiverSession } from "@/lib/page-auth"; import { getCaregiverDisplayName } from "@/lib/session"; export const dynamic = "force-dynamic"; export default async function DevicesPage() { const caregiver = await requireCaregiverSession("/devices"); const devices = await getCaregiverDevices(caregiver.id); return ( } >

使用说明

如何连接长辈的设备?

1. 让长辈打开手机上的「家人连接」页面,屏幕会显示一个二维码。

2. 您用自己的手机扫描这个二维码,或将设备码粘贴到左侧输入框。

3. 连接成功后,即可在这里查看长辈的留言、对话和使用动态。

扫码连接 查看留言
{devices.length === 0 ? (

还没有连接设备

扫描长辈手机上的二维码,或者在上方粘贴设备码,即可开始接收长辈的留言和动态。

) : (
{devices.map((binding) => { const latestMessage = binding.elderDevice.messages[0]; return (

已连接

{getDeviceName(binding.elderDevice.displayName)}

最近在线:{formatDateTime(binding.elderDevice.lastSeenAt)} 新留言 {binding.elderUnreadCount} 待查看 {binding.familyUnreadCount}

留言

{binding.elderDevice._count.messages}

对话

{binding.elderDevice._count.conversationTurns}

智能服务

{binding.elderDevice._count.toolCalls}

最新动态

{latestMessage ? truncateText(latestMessage.content, 96) : "还没有收到新的留言或问候。"}

查看详情 查看留言
); })}
)}
); }