import React from "react"; import { Entity, FieldProps } from "../../types"; import { PropertyPreview } from "../../preview"; import { FieldHelperText, LabelWithIcon } from "../components"; import { ErrorBoundary } from "../../components"; import { getIconForProperty } from "../../util"; import { cn, paperMixin } from "@firecms/ui"; /** * * Simply render the non-editable preview of a field * * This is one of the internal components that get mapped natively inside forms * and tables to the specified properties. * @group Form fields */ export function ReadOnlyFieldBinding({ propertyKey, value, error, showError, tableMode, property, includeDescription, context }: FieldProps) { if (!context.entityId) throw new Error("ReadOnlyFieldBinding: Entity id is null"); const entity: Entity = { id: context.entityId!, values: context.values, path: context.path }; return ( <> {!tableMode && }
); }