import React, { useEffect } from 'react';
import { DocusealBuilder as OriginalDocusealBuilder } from '@docuseal/react';

const DocusealBuilder = ({ onSave, onSend, ...props }) => {
  useEffect(() => {
    if (onSave) {
      props.save = onSave;
    }
    if (onSend) {
      props.send = onSend;
    }
  }, [onSave, onSend, props]);

  return <OriginalDocusealBuilder {...props} />;
};

export default DocusealBuilder;
