diff --git a/src/components/feed/MilestoneCard.tsx b/src/components/feed/MilestoneCard.tsx index f1ccc55..9e3326a 100644 --- a/src/components/feed/MilestoneCard.tsx +++ b/src/components/feed/MilestoneCard.tsx @@ -1,7 +1,9 @@ "use client"; -import type { MilestoneType } from "@prisma/client"; +import { useState } from "react"; +import { MessageCircle } from "lucide-react"; import { useTranslations } from "next-intl"; +import { useActivePet } from "@/context/ActivePetContext"; import { MILESTONE_META } from "@/lib/milestone-meta"; import { getAvatarUrl } from "@/lib/avatar-url"; import { formatPetName } from "@/lib/pet-display-name"; @@ -9,20 +11,14 @@ import { getMediaUrl } from "@/lib/media-url"; import { BlurImage } from "@/components/ui/blur-image"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { AiDisclosureBadge } from "@/components/content/AiDisclosureBadge"; -import type { AiDisclosureValue } from "@/components/content/AiDisclosureSelect"; - -type MilestoneCardPost = { - id: string; - caption: string | null; - createdAt: Date | string; - aiDisclosure?: AiDisclosureValue; - pet: { id: string; name: string; avatarKey: string | null }; - images: { id: string; storageKey: string; position: number; blurhash?: string | null }[]; - milestone: { milestoneType: MilestoneType; notes: string | null } | null; -}; +import { PawButton } from "@/components/feed/PawButton"; +import { PawBackButton } from "@/components/feed/PawBackButton"; +import { PostDetailDialog } from "@/components/feed/PostDetailDialog"; +import type { PostCardPost } from "@/components/feed/PostCard"; interface MilestoneCardProps { - post: MilestoneCardPost; + post: PostCardPost; + onDeleted?: (postId: string) => void; } function formatDate(date: Date | string): string { @@ -40,8 +36,10 @@ function formatDate(date: Date | string): string { * + pet name + date + optional caption/notes + optional photo. * Background: bg-orange-50 border border-orange-200 per UI-SPEC accent reservation #8. */ -export function MilestoneCard({ post }: MilestoneCardProps) { +export function MilestoneCard({ post, onDeleted }: MilestoneCardProps) { const t = useTranslations("MilestoneTypes"); + const { activePetId } = useActivePet(); + const [showDetailDialog, setShowDetailDialog] = useState(false); const { pet, milestone, images, caption } = post; if (!milestone) return null; @@ -51,7 +49,7 @@ export function MilestoneCard({ post }: MilestoneCardProps) { const photo = images[0]; return ( -
+
{/* Header */}
@@ -98,6 +96,35 @@ export function MilestoneCard({ post }: MilestoneCardProps) { )}
)} + + {/* Action row — paw reaction + comment count + paw-back, same as PostCard */} + {activePetId && ( +
+ + + +
+ )} + + setShowDetailDialog(false)} + onDeleted={onDeleted} + />
); } diff --git a/src/components/feed/PostCard.tsx b/src/components/feed/PostCard.tsx index 91eab43..2d2ef2e 100644 --- a/src/components/feed/PostCard.tsx +++ b/src/components/feed/PostCard.tsx @@ -223,7 +223,7 @@ function PostCardImpl({ post, onDeleted, variant = "feed" }: PostCardProps) { // Milestone posts use their own distinct card (MILE-02) if (post.type === "MILESTONE") { - return ; + return ; } // Repost posts delegate to RepostCard