function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from "react";
import useAAColorType from "../../utils/useAAColorType";
import StackedAnnotations from "../StackedAnnotations";
import Translation from "./Translation";
function getExtraInnerCompProps(annotationRange, _ref) {
  var showAminoAcidNumbers = _ref.showAminoAcidNumbers,
    getGaps = _ref.getGaps,
    isProtein = _ref.isProtein,
    colorType = _ref.colorType,
    annotationHeight = _ref.annotationHeight,
    spaceBetweenAnnotations = _ref.spaceBetweenAnnotations,
    sequenceLength = _ref.sequenceLength,
    aminoAcidNumbersHeight = _ref.aminoAcidNumbersHeight;
  var anotationHeightNoSpace = annotationHeight - spaceBetweenAnnotations;
  return {
    showAminoAcidNumbers: showAminoAcidNumbers,
    getGaps: getGaps,
    height: anotationHeightNoSpace,
    aminoAcidNumbersHeight: aminoAcidNumbersHeight,
    annotationRange: annotationRange,
    isProtein: isProtein,
    colorType: colorType,
    sequenceLength: sequenceLength
  };
}
function Translations(props) {
  var _useAAColorType = useAAColorType(),
    colorType = _useAAColorType[0];
  return /*#__PURE__*/React.createElement(StackedAnnotations, _extends({}, props, {
    annotationRanges: props.annotationRanges.filter(function (t) {
      return !t.isJoinedLocation;
    }),
    annotationHeight: props.annotationHeight + (props.showAminoAcidNumbers ? props.aminoAcidNumbersHeight : 0),
    disregardLocations: true,
    getExtraInnerCompProps: getExtraInnerCompProps,
    InnerComp: Translation,
    colorType: colorType
  }));
}
export default Translations;