"use client"; import { useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; import { adminFetch } from "@/lib/admin-fetch"; import type { NitroQuality, ScaleReport } from "@/lib/furni/nitro-quality"; function ScalePanel({ report, classname, revision, }: { report: ScaleReport; classname: string; revision: number; }) { const [asset, setAsset] = useState(report.assets[0] ?? ""), [failed, setFailed] = useState(false); return (

Scale {report.size} ·{" "} {report.state === "missing" ? "Not included" : report.state === "issues" ? "Needs review" : "Present"}

{report.assets.length} sprites · {report.animations.length} animation definitions · directions {report.directions.join(", ") || "—"}

{report.state === "missing" && (

This bundle contains no sprites at this scale. Missing scale 32 does not by itself mean the furniture is unusable.

)} {report.assets.length > 0 && ( <>
{failed ? (

This sprite could not be rendered.

) : ( {asset} setFailed(true)} /> )}
)} {report.issues.length > 0 && ( )}
); } export function NitroQualityPanel({ classname }: { classname: string }) { const [report, setReport] = useState(null), [error, setError] = useState(""), [revision, setRevision] = useState(0); useEffect(() => { const controller = new AbortController(); setReport(null); setError(""); void (async () => { try { const response = await adminFetch( `/api/admin/studio/nitro-quality?classname=${encodeURIComponent(classname)}&v=${revision}`, { signal: controller.signal }, ); const data = await response.json(); if (!response.ok) throw Error(data.error || "Inspection failed"); if (!controller.signal.aborted) setReport(data.report); } catch (error) { if (!controller.signal.aborted) setError( error instanceof Error ? error.message : "Inspection failed", ); } })(); return () => controller.abort(); }, [classname, revision]); return (

Inspect the saved bundle at both scales. Previews show individual sprites, not the assembled furniture or animation playback.

{error ? (

{error}

) : !report ? (

Checking scales and texture references…

) : (
{report.scales.map((scale) => ( ))}
)}
); }