import { cx } from '@linaria/core';
import Empty from '../Empty/index.js';
import { ParrotTrans } from '../ParrotTrans/index.js';
import isEmpty from '../../utils/isEmpty.js';
import { formatSeconds } from '../../utils/tower.js';
import React__default from 'react';
import { UnitStyle } from '../Styled/index.js';

var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
const Second = ({
  rawValue,
  decimals,
  valueClassName,
  unitClassName,
  abbreviate,
  emptyProps
}) => {
  if (isEmpty(rawValue)) {
    return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues({}, emptyProps));
  }
  const { value, unit } = formatSeconds(rawValue, decimals);
  return /* @__PURE__ */ React__default.createElement(
    ParrotTrans,
    {
      parent: "span",
      i18nKey: `unit.${abbreviate ? `${unit}_abbreviation` : unit}`,
      count: value
    },
    /* @__PURE__ */ React__default.createElement("span", { className: cx("value", valueClassName) }),
    /* @__PURE__ */ React__default.createElement("span", { className: cx("unit", UnitStyle, unitClassName) })
  );
};
var Second$1 = Second;

export { Second$1 as default };
