+
- = {
+ civilian: "Civilian",
+ utility: "Utility",
+ transport: "Transport",
+ drone: "Drone",
+ weaponized: "Weaponized",
+ static: "Static",
+ military: "Military",
+};
+
+/** Pill classes (Tailwind): -500/20 background with matching -400 text. */
+export const VEHICLE_CATEGORY_COLORS: Record = {
+ civilian: "bg-stone-500/20 text-stone-400",
+ utility: "bg-emerald-500/20 text-emerald-400",
+ transport: "bg-blue-500/20 text-blue-400",
+ drone: "bg-violet-500/20 text-violet-400",
+ weaponized: "bg-red-500/20 text-red-400",
+ static: "bg-slate-500/20 text-slate-400",
+ military: "bg-amber-500/20 text-amber-400",
+};
+
+export function categoryPillClasses(category: string): string {
+ return VEHICLE_CATEGORY_COLORS[category] ?? "bg-muted text-muted-foreground";
+}
+
+export function categoryLabel(category: string): string {
+ return VEHICLE_CATEGORY_LABELS[category] ?? category;
+}
+ {categories.map((cat) => (
- {categoryLabels[cat] ?? cat}
+ {categoryLabel(cat)}
))}
-
-
- {truncatedDescription && (
- {truncatedDescription ?? vehicle.classname ?? "Vehicle"}
-
- View details
-
-
+ ))}
+
+ Open
+
+
+
+
);
}
diff --git a/src/lib/vehicles/categories.ts b/src/lib/vehicles/categories.ts
new file mode 100644
index 00000000..663efe8f
--- /dev/null
+++ b/src/lib/vehicles/categories.ts
@@ -0,0 +1,33 @@
+/**
+ * Single source of truth for vehicle category presentation. The card grid and
+ * the detail page both read from here so colors and labels never drift apart.
+ */
+
+export const VEHICLE_CATEGORY_LABELS: Record{truncatedDescription}
- )} -
- {materialCount > 0 && (
-
- {materialCount} material{materialCount !== 1 ? "s" : ""}
- {constructionTime != null && (
- <>
- ,
- {constructionTime} tick{constructionTime !== 1 ? "s" : ""}
- >
- )}
-
- )}
- {maxHealth != null && (
-
-
- {maxHealth.toLocaleString()} HP
-
- )}
- {maxSpeed != null && (
-
-
- {maxSpeed} km/h
-
+ {vehicle.classname && (
+
+
+ {/* Permanent readout footer */}
+ + {vehicle.classname} +
+ )} ++ {vehicle.name} +
+ {truncatedDescription && ( ++ {truncatedDescription} +
+ )} +
+ {readoutCells.map((cell, i) => (
+
-
-
+
- {cell.value}
+{cell.label}