import React from 'react';
import { locales } from '@pisell/utils';
import classNames from 'classnames';
var I18N_NOW = 'pisell-time-navigator.now';
/**
 * Now 按钮：固定入口，点击跳回当前时间并进入 Realtime
 * 横向：右侧，左箭头；竖向：底部，上箭头
 */
export function NowButton(_ref) {
  var orientation = _ref.orientation,
    onClick = _ref.onClick,
    style = _ref.style,
    className = _ref.className,
    renderCustom = _ref.renderCustom;
  var raw = locales.getText(I18N_NOW);
  var label = raw && raw !== I18N_NOW ? raw : 'Now';
  if (renderCustom) {
    return /*#__PURE__*/React.createElement("button", {
      type: "button",
      className: classNames('pisell-time-navigator-now', className),
      onClick: onClick,
      style: style,
      "aria-label": label
    }, renderCustom());
  }
  return /*#__PURE__*/React.createElement("button", {
    type: "button",
    className: classNames('pisell-time-navigator-now', "pisell-time-navigator-now--".concat(orientation), className),
    onClick: onClick,
    style: style,
    "aria-label": label
  }, /*#__PURE__*/React.createElement("span", {
    className: "pisell-time-navigator-now-icon",
    "aria-hidden": true
  }), /*#__PURE__*/React.createElement("span", {
    className: "pisell-time-navigator-now-label"
  }, label));
}