remove collapsible around root section

This commit is contained in:
Josh Hawkins 2026-01-27 17:10:41 -06:00
parent bc5d7cf575
commit de6ad5a32a

View File

@ -13,13 +13,17 @@ import { useTranslation } from "react-i18next";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
export function ObjectFieldTemplate(props: ObjectFieldTemplateProps) { export function ObjectFieldTemplate(props: ObjectFieldTemplateProps) {
const { title, description, properties, uiSchema } = props; const { title, description, properties, uiSchema, registry, schema } = props;
const { idSchema } = props as ObjectFieldTemplateProps & {
idSchema?: { $id?: string };
};
const formContext = (props as Record<string, unknown>).formContext as const formContext = (props as Record<string, unknown>).formContext as
| Record<string, unknown> | Record<string, unknown>
| undefined; | undefined;
// Check if this is a root-level object // Check if this is a root-level object
const isRoot = !title; const isRoot = idSchema?.$id === "root" || registry?.rootSchema === schema;
const [isOpen, setIsOpen] = useState(true); const [isOpen, setIsOpen] = useState(true);
const { t } = useTranslation([ const { t } = useTranslation([