import React, { useRef } from 'react';
import PisellScan from "../../pisellScan";
import "./index.less";
import { getText } from "../../../locales";
var Scan = function Scan(props) {
  var onChange = props.onChange,
    onCancel = props.onCancel;
  var scanRef = useRef(null);
  return /*#__PURE__*/React.createElement(PisellScan, {
    width: "100%",
    height: "200px",
    borderRadius: "12px",
    onChange: onChange,
    timeBetweenScansMillis: 1000,
    ref: scanRef
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-scan-custom-action"
  }, /*#__PURE__*/React.createElement("span", {
    onClick: function onClick() {
      var _scanRef$current, _scanRef$current$code;
      (_scanRef$current = scanRef.current) === null || _scanRef$current === void 0 ? void 0 : (_scanRef$current$code = _scanRef$current.codeReader) === null || _scanRef$current$code === void 0 ? void 0 : _scanRef$current$code.reset();
      onCancel();
    }
  }, getText('pisell-information-entry-scan-exit'))));
};
export default Scan;