+ {/* Header */} + + + {avatarUrl && } + + {pet.name[0]?.toUpperCase() ?? "?"} + + + + + {pet.name} + + {formatDate(post.createdAt)} + + + + {/* Milestone type badge */} + + + {meta.label} + + + {/* Optional photo */} + {photo && ( + + {/* eslint-disable-next-line @next/next/no-img-element */} + + + )} + + {/* Caption or notes */} + {(caption || milestone.notes) && ( + + {caption && {caption}} + {milestone.notes && ( + {milestone.notes} + )} + + )} +
{/* Header row — 16px horizontal padding, 12px vertical */} diff --git a/src/lib/milestone-meta.ts b/src/lib/milestone-meta.ts new file mode 100644 index 0000000..a3818c5 --- /dev/null +++ b/src/lib/milestone-meta.ts @@ -0,0 +1,52 @@ +import { MilestoneType } from "@prisma/client"; +import { + Cake, + Heart, + Leaf, + Stethoscope, + Milk, + Trophy, + Star, + Award, + type LucideIcon, +} from "lucide-react"; + +export interface MilestoneMeta { + label: string; + icon: LucideIcon; +} + +/** + * Maps every MilestoneType to a display label and Lucide icon (D-09, UI-SPEC). + * Used by MilestoneCard and MilestoneForm. + */ +export const MILESTONE_META: Record = { + BIRTHDAY: { label: "Birthday", icon: Cake }, + ADOPTION_DAY: { label: "Adoption Day", icon: Heart }, + FIRST_OUTING: { label: "First Outing", icon: Leaf }, + VET_VISIT: { label: "Vet Visit", icon: Stethoscope }, + LITTER: { label: "New Litter", icon: Milk }, + FOLLOWERS_500: { label: "500 Followers", icon: Trophy }, + FOLLOWERS_1K: { label: "1,000 Followers", icon: Trophy }, + FOLLOWERS_2_5K: { label: "2,500 Followers", icon: Trophy }, + FOLLOWERS_5K: { label: "5,000 Followers", icon: Trophy }, + FOLLOWERS_10K: { label: "10,000 Followers", icon: Star }, + FOLLOWERS_25K: { label: "25,000 Followers", icon: Star }, + FOLLOWERS_50K: { label: "50,000 Followers", icon: Star }, + FOLLOWERS_100K: { label: "100,000 Followers", icon: Star }, + FOLLOWERS_250K: { label: "250,000 Followers", icon: Award }, + FOLLOWERS_500K: { label: "500,000 Followers", icon: Award }, + FOLLOWERS_1M: { label: "1,000,000 Followers", icon: Award }, +}; + +/** + * The 5 user-initiated milestone types shown in the creation picker. + * Follower-threshold types are auto-triggered (D-10) and excluded from the form. + */ +export const USER_INITIATED_MILESTONE_TYPES = [ + MilestoneType.BIRTHDAY, + MilestoneType.ADOPTION_DAY, + MilestoneType.FIRST_OUTING, + MilestoneType.VET_VISIT, + MilestoneType.LITTER, +] as const;