import cs from 'classnames';
import dayjs from 'dayjs';
import React__default from 'react';

const timeWrapper = "E_4100_0_7_tju3gfj";
const Time = ({
  className,
  date,
  dateTemplate = "YYYY-MM-DD",
  timeTemplate = "HH:mm",
  plainText,
  "data-testid": dataTestId
}) => {
  if (!date) return /* @__PURE__ */React__default.createElement(React__default.Fragment, null, "-");
  const time = dayjs(date);
  if (plainText) {
    return /* @__PURE__ */React__default.createElement(React__default.Fragment, null, dateTemplate !== null && time.format(dateTemplate), " ", timeTemplate !== null && time.format(timeTemplate));
  }
  return /* @__PURE__ */React__default.createElement("span", {
    "data-testid": dataTestId,
    className: cs("time-wrapper", timeWrapper, className)
  }, dateTemplate !== null && /* @__PURE__ */React__default.createElement("span", {
    className: "date"
  }, time.format(dateTemplate)), timeTemplate !== null && /* @__PURE__ */React__default.createElement("span", {
    className: "time"
  }, time.format(timeTemplate)));
};
var Time$1 = Time;

export { Time$1 as default };
