/** * @prettier */ import React from "react" import PropTypes from "prop-types" const Example = ({ schema, getSystem }) => { const { fn } = getSystem() const { hasKeyword, stringify } = fn.jsonSchema202012.useFn() if (!hasKeyword(schema, "example")) return null return (
Example {stringify(schema.example)}
) } Example.propTypes = { schema: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]).isRequired, getSystem: PropTypes.func.isRequired, } export default Example