index.tsx 987 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { memo } from 'react'
  2. import { MiniMap } from 'reactflow'
  3. import UndoRedo from '../header/undo-redo'
  4. import ZoomInOut from './zoom-in-out'
  5. import Control from './control'
  6. export type OperatorProps = {
  7. handleUndo: () => void
  8. handleRedo: () => void
  9. }
  10. const Operator = ({ handleUndo, handleRedo }: OperatorProps) => {
  11. return (
  12. <>
  13. <MiniMap
  14. pannable
  15. zoomable
  16. style={{
  17. width: 102,
  18. height: 72,
  19. }}
  20. maskColor='var(--color-workflow-minimap-bg)'
  21. className='!absolute !left-4 !bottom-14 z-[9] !m-0 !w-[102px] !h-[72px] !border-[0.5px] !border-divider-subtle
  22. !rounded-lg !shadow-md !shadow-shadow-shadow-5 !bg-background-default-subtle'
  23. />
  24. <div className='flex items-center mt-1 gap-2 absolute left-4 bottom-4 z-[9]'>
  25. <ZoomInOut />
  26. <UndoRedo handleUndo={handleUndo} handleRedo={handleRedo} />
  27. <Control />
  28. </div>
  29. </>
  30. )
  31. }
  32. export default memo(Operator)