"use client"; import { Button } from "@/components/ui/button"; import { compareFurniture, type FurnitureInspection, furnitureHealth, } from "@/lib/furni/studio-inspection"; import { FurnitureCompleteness } from "./furniture-completeness"; import type { FurniItem } from "./studio-types"; import { useFurnitureInspection } from "./use-furniture-inspection"; export function FurnitureComparison({ item, local, }: { item: FurniItem; local: FurnitureInspection; }) { const comparison = compareFurniture(item, local); return (
Local furnidata could not be read. Its values are not verified.
)}| Field | Local now | Source |
|---|---|---|
| {field.label} {field.changed ? " · Changed" : ""} | {field.before ?? "—"} | {field.after ?? "Not supplied"} |
Source values are compared with local data. Import may remap IDs and translate names. Existing furniture keeps its local IDs and SQL settings; new furniture receives a free local ID when the source ID is occupied.
Item #{row.id} · Sprite #{row.spriteId} · {row.name}
)) ) : (No local SQL item.
)} {local.catalog.map((row) => (Offer #{row.id} · Page #{row.pageId} · {row.credits} credits +{" "} {row.points} points
))}Checking local data and assets…
); if (inspection.error) return ({inspection.error}
Missing: {health.missing.join(", ")}
)} {health.state === "conflict" && (Duplicate records or mismatched IDs/types require review before repair.
)} {health.state === "unknown" && (Some local data could not be checked. Retry verification before repair.
)} {health.state === "incomplete" && onRepair && ( <>Repair adds missing parts and preserves existing IDs, settings, furnidata and catalog offers. Missing offers use the automatic category and price shown below.
> )}Local inspection unavailable.
); }