PanelCanvas.tsx 871 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React from "react";
  2. import { Panel } from "../Panel";
  3. import { ActionManager } from "../../actions";
  4. import { ExcalidrawElement } from "../../element/types";
  5. import { AppState } from "../../types";
  6. import { UpdaterFn } from "../../actions/types";
  7. interface PanelCanvasProps {
  8. actionManager: ActionManager;
  9. elements: readonly ExcalidrawElement[];
  10. appState: AppState;
  11. syncActionResult: UpdaterFn;
  12. }
  13. export const PanelCanvas: React.FC<PanelCanvasProps> = ({
  14. actionManager,
  15. elements,
  16. appState,
  17. syncActionResult
  18. }) => {
  19. return (
  20. <Panel title="Canvas">
  21. {actionManager.renderAction(
  22. "changeViewBackgroundColor",
  23. elements,
  24. appState,
  25. syncActionResult
  26. )}
  27. {actionManager.renderAction(
  28. "clearCanvas",
  29. elements,
  30. appState,
  31. syncActionResult
  32. )}
  33. </Panel>
  34. );
  35. };