UNPKG

@focuson/form_components

Version:

Components that can be used by @focuson/forms

12 lines (11 loc) 720 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExternalComponent = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); function ExternalComponent({ id, state, nameOfComponentFn }) { var _a; const componentFn = (_a = state.context.dependencies) === null || _a === void 0 ? void 0 : _a[nameOfComponentFn]; console.log('ExternalComponent', state.context, nameOfComponentFn); return componentFn ? componentFn(id, state) : (0, jsx_runtime_1.jsx)("div", Object.assign({ id: id }, { children: (0, jsx_runtime_1.jsxs)("p", { children: ["The External Component ", nameOfComponentFn, " will be displayed here"] }) })); } exports.ExternalComponent = ExternalComponent;