"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _Text = _interopRequireDefault(require("../Text"));
var _TimelineItemSt = require("./TimelineItem.st.css.js");
var _Timeline = require("./Timeline.constants");
var _StringUtils = require("../utils/StringUtils");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/Timeline/TimelineItem.tsx";
/** A timeline item is a display of a timeline event */
function TimelineItem(_ref) {
  var {
    idx,
    item,
    dataHook,
    gap,
    skin = 'dark'
  } = _ref;
  var {
    customPrefix,
    suffix,
    label,
    labelAction,
    line = 'filled'
  } = item;
  return /*#__PURE__*/_react.default.createElement("li", {
    className: (0, _TimelineItemSt.st)(_TimelineItemSt.classes.event, {
      skin
    }),
    "data-hook": dataHook,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 20,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
    className: _TimelineItemSt.classes.prefix,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 22,
      columnNumber: 9
    }
  }, customPrefix ? /*#__PURE__*/_react.default.createElement("div", {
    "data-hook": "".concat(_Timeline.dataHooks.timelineBulletIndicator, "-").concat(idx),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 24,
      columnNumber: 13
    }
  }, customPrefix) : /*#__PURE__*/_react.default.createElement("div", {
    "data-hook": "".concat(_Timeline.dataHooks.timelineDefaultPrefix, "-").concat(idx),
    className: _TimelineItemSt.classes.defaultIndicator,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 28,
      columnNumber: 13
    }
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _TimelineItemSt.st)(_TimelineItemSt.classes.line, {
      line
    }),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 33,
      columnNumber: 11
    }
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _TimelineItemSt.st)(_TimelineItemSt.classes.label, {
      withSuffix: !!suffix
    }),
    style: {
      [_TimelineItemSt.vars.marginBottom]: gap
    },
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 35,
      columnNumber: 9
    }
  }, (0, _StringUtils.isString)(label) ? /*#__PURE__*/_react.default.createElement(_Text.default, {
    dataHook: "".concat(_Timeline.dataHooks.timelineLabel, "-").concat(idx),
    weight: "thin",
    size: "small",
    className: _TimelineItemSt.classes.labelText,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 40,
      columnNumber: 13
    }
  }, label) : label, labelAction ? /*#__PURE__*/_react.default.createElement("div", {
    className: _TimelineItemSt.classes.labelAction,
    "data-hook": "".concat(_Timeline.dataHooks.timelineLabelAction, "-").concat(idx),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 52,
      columnNumber: 13
    }
  }, labelAction) : null), suffix ? /*#__PURE__*/_react.default.createElement("div", {
    className: _TimelineItemSt.classes.suffix,
    "data-hook": "".concat(_Timeline.dataHooks.timelineSuffix, "-").concat(idx),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 61,
      columnNumber: 11
    }
  }, (0, _StringUtils.isString)(suffix) ? /*#__PURE__*/_react.default.createElement(_Text.default, {
    dataHook: "".concat(_Timeline.dataHooks.timelineTextSuffix, "-").concat(idx),
    weight: "thin",
    light: true,
    secondary: true,
    size: "small",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 66,
      columnNumber: 15
    }
  }, suffix) : suffix) : null));
}
TimelineItem.displayName = 'TimelineItem';
var _default = exports.default = TimelineItem;
//# sourceMappingURL=TimelineItem.js.map