import React from "react";
import { convertDnaCaretPositionOrRangeToAA } from "@teselagen/sequence-utils";
import { convertRangeTo1Based } from "@teselagen/range-utils";
export var sizeSchema = {
  path: "size",
  displayName: "尺寸",
  type: "number",
  render: function render(val, _record, i, props) {
    var record = props.isProtein ? convertDnaCaretPositionOrRangeToAA(_record) : _record;
    var base1Range = convertRangeTo1Based(record);
    var hasJoinedLocations = record.locations && record.locations.length > 1;
    return /*#__PURE__*/React.createElement("span", null, props.isProtein ? Math.floor(val / 3) : val, " ", /*#__PURE__*/React.createElement("span", {
      style: {
        fontSize: 10
      }
    }, hasJoinedLocations ? record.locations.map(function (loc, i) {
      var base1Range = convertRangeTo1Based(loc);
      return /*#__PURE__*/React.createElement("span", {
        key: i
      }, "(", base1Range.start, "-", base1Range.end, ")");
    }) : /*#__PURE__*/React.createElement("span", null, "(", base1Range.start, "-", base1Range.end, ")")));
  }
};