import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import React from "react";
import NLPAnnotator from "react-nlp-annotate";
import Box from "@material-ui/core/Box";
export default (function (_ref) {
  var sampleIndex = _ref.sampleIndex,
      sample = _ref.sample,
      iface = _ref.interface,
      onModifySample = _ref.onModifySample,
      onExit = _ref.onExit;
  return /*#__PURE__*/React.createElement(NLPAnnotator, {
    key: sampleIndex,
    titleContent: /*#__PURE__*/React.createElement(Box, {
      paddingLeft: 4
    }, "Sample ", sampleIndex),
    type: "transcribe",
    audio: sample.audioUrl,
    phraseBank: iface.phraseBank,
    initialTranscriptionText: sample.annotation || "",
    onPrev: function onPrev(result) {
      onModifySample(_objectSpread(_objectSpread({}, sample), {}, {
        annotation: result
      }));
      onExit("go-to-previous");
    },
    onNext: function onNext(result) {
      onModifySample(_objectSpread(_objectSpread({}, sample), {}, {
        annotation: result
      }));
      onExit("go-to-next");
    },
    onFinish: function onFinish(result) {
      onModifySample(_objectSpread(_objectSpread({}, sample), {}, {
        annotation: result
      }));
      onExit();
    }
  });
});