"use client"; import { DEFAULT_RIBBON } from "@/components/awards/ribbonDesign/constants"; import { RibbonArt } from "@/components/awards/ribbonDesign/RibbonArt"; import type { RibbonDesign } from "@/components/awards/ribbonDesign/types"; import { useState } from "react"; import { cn } from "@/lib/utils"; /** * Production ribbon renderer. Thin wrapper around the shared `RibbonArt` so * the live site and the admin/studio previews cannot drift apart. Pass an * award's `advancement.tier` to let the device cluster derive its count from * the tier (service-star convention); omit it to show the authored devices. */ export const RibbonViewer = ({ ribbonDesign, showRibbonOnly, tier, }: { ribbonDesign: RibbonDesign; showRibbonOnly?: boolean; tier?: number | null; }) => { const initial: RibbonDesign = ribbonDesign && typeof ribbonDesign === "object" && Array.isArray((ribbonDesign as RibbonDesign).stripes) ? (ribbonDesign as RibbonDesign) : DEFAULT_RIBBON; const [design] = useState(initial); return ( ); };