"use client"; import Link from "next/link"; import { motion } from "framer-motion"; import { cn } from "@/vendor/ui/cn"; import type { SkuTemplate } from "@/vendor/carrier/types"; interface PlanCardProps { plan: SkuTemplate; href?: string; onSelect?: (plan: SkuTemplate) => void; featured?: boolean; /** * This plan is the one currently in the order summary. Only meaningful on * the select-then-continue flow; a card that links straight to checkout is * never in a selected state. */ selected?: boolean; } export function PlanCard({ plan, href, onSelect, featured, selected }: PlanCardProps) { const destination = href ?? (onSelect ? undefined : `/checkout/${plan.id}`); function handleSelect() { onSelect?.(plan); } const inner = ( <> {featured && ( Most popular )}
{plan.name}
{plan.description}