import * as React from 'react';

import { Signature } from './signature_view';
import { FormComponentProps, EditorComponent } from '@tomino/dynamic-form';

// TODO:
const SignatureEditorComponent = (props: FormComponentProps) => (
  <Signature
    readOnly={true}
    owner={props.owner}
    formElement={props.formElement}
    handlers={props.handlers}
    catalogue={props.catalogue as any}
  />
);

export const SignatureEditor: EditorComponent = {
  Component: SignatureEditorComponent,
  title: 'Signature',
  control: 'Signature',
  icon: 'edit',
  bound: true
};
