import { useTranslation } from "react-i18next"; import type { SportType } from "@trails-cool/db/schema/journal"; // Emoji glyphs as lightweight, dependency-free sport icons. The localized // label carries the meaning; the glyph is decorative (aria-hidden). const SPORT_EMOJI: Record = { hike: "🥾", walk: "🚶", run: "🏃", ride: "🚴", gravel: "🚲", mtb: "🚵", ski: "⛷️", other: "📍", }; /** * Small pill (glyph + localized label) shown next to an activity title on the * detail page, feed cards, and the profile list. Renders nothing when the * sport type is unset. */ export function SportBadge({ sportType, className, }: { sportType: SportType | null | undefined; className?: string; }) { const { t } = useTranslation("journal"); if (!sportType) return null; return ( {SPORT_EMOJI[sportType]} {t(`activities.sport.${sportType}`)} ); }