import { createCategory, createValue, deleteCategory, deleteValue, } from "@/actions/admin-rare-values"; import { StatusCard } from "@/components/admin/dashboard"; import { prisma } from "@/lib/prisma"; export const dynamic = "force-dynamic"; const CURRENCY_TYPES = ["diamonds", "credits", "duckets", "points"]; export default async function AdminRareValues() { let categories: Awaited> = []; try { categories = await prisma.websiteRareValueCategories.findMany({ orderBy: [{ priority: "asc" }, { name: "asc" }], }); } catch { categories = []; } let values: Awaited> = []; try { values = await prisma.websiteRareValues.findMany({ orderBy: { name: "asc" }, }); } catch { values = []; } const valuesByCategory = new Map(); for (const v of values) { const key = String(v.categoryId); const list = valuesByCategory.get(key); if (list) list.push(v); else valuesByCategory.set(key, [v]); } return (

Rare Values

Catalog of rare furni and their trade values, grouped by category. Each category is rendered as a tab on the public rare values page.

New category

{categories.length === 0 ? (

No categories yet. Add one above to start.

) : null}
{categories.map((cat) => { const catId = String(cat.id); const rows = valuesByCategory.get(catId) ?? []; return (
{cat.name} badge {cat.badge} priority {cat.priority} {rows.length} item{rows.length === 1 ? "" : "s"}
{rows.map((v) => ( ))}
Name Item ID Credit value Currency value Currency Icon
{v.name} {v.itemId ?? "—"} {v.creditValue ?? "—"} {v.currencyValue ?? "—"} {v.currencyType} {v.furnitureIcon}
{rows.length === 0 ? (

No values in this category yet.

) : null}
); })}
); }