notFound.tsx 738 B

123456789101112131415161718192021222324252627282930313233343536
  1. import React, { PureComponent } from 'react';
  2. import { CanvasElementItem, CanvasElementProps } from '../element';
  3. interface NotFoundConfig {
  4. orig?: any;
  5. }
  6. class NotFoundDisplay extends PureComponent<CanvasElementProps<NotFoundConfig>> {
  7. render() {
  8. const { config } = this.props;
  9. return (
  10. <div>
  11. <h3>NOT FOUND:</h3>
  12. <pre>{JSON.stringify(config, null, 2)}</pre>
  13. </div>
  14. );
  15. }
  16. }
  17. export const notFoundItem: CanvasElementItem<NotFoundConfig> = {
  18. id: 'not-found',
  19. name: 'Not found',
  20. description: 'Display when element type is not found in the registry',
  21. display: NotFoundDisplay,
  22. defaultSize: {
  23. width: 100,
  24. height: 100,
  25. },
  26. getNewOptions: () => ({
  27. config: {},
  28. }),
  29. };