| 2 | import app from 'xadmin' |
| 3 | |
| 4 | const C = args => { |
| 5 | if(typeof args == 'string') { |
| 6 | return app.get('components')[args] |
| 7 | } else { |
| 8 | const { is, ...props } = args |
| 9 | const Component = C(is) |
| 10 | if(Component) |
| 11 | return <Component {...props} /> |
| 12 | else |
| 13 | return <div>Component {is} not found.</div> |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | C.lazy = is => props => C({ is, ...props }) |
| 18 |
no test coverage detected