"use client"; import { useState, useEffect } from "react"; import { useParams } from "next/navigation"; import type { Pet, Schedule } from "@/types"; import { Card } from "@/components/ui/Card"; import { Button } from "@/components/ui/Button"; import { PetCard } from "@/components/pet/PetCard"; import { ScheduleCard } from "@/components/pet/ScheduleCard"; import { EmptyState } from "@/components/ui/EmptyState"; export default function PetDetailPage() { const params = useParams(); const [pet, setPet] = useState(null); const [schedules, setSchedules] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { // TODO: Replace with actual API call const loadData = async () => { setLoading(true); // Simulated data setPet({ id: params.id as string, ownerId: "u1", name: "毛球", species: "猫", breed: "英短", birthDate: "2023-03-15", weightKg: 4.5, avatarUrl: "", createdAt: new Date().toISOString(), }); setSchedules([ { id: "s1", petId: params.id as string, type: "vaccine", title: "年度疫苗", scheduledAt: "2026-07-01T09:00:00Z", completed: false }, { id: "s2", petId: params.id as string, type: "deworming", title: "季度驱虫", scheduledAt: "2026-06-15T10:00:00Z", completed: false }, { id: "s3", petId: params.id as string, type: "checkup", title: "体检", scheduledAt: "2026-05-20T14:00:00Z", completed: true }, ]); setLoading(false); }; loadData(); }, [params.id]); if (loading) return
; if (!pet) return ; return (
{/* Pet Profile */}
{pet.avatarUrl ? {pet.name} : "🐱"}

{pet.name}

{pet.breed} · {pet.weightKg}kg · {pet.species}

{/* Health Schedule */}

健康日程

{schedules.length > 0 ? schedules.map(s => ) : }
{/* Quick Info */}

{pet.weightKg}

体重 (kg)

{new Date().getFullYear() - new Date(pet.birthDate).getFullYear()}岁

年龄

); }