import React from 'react';
import { formatWeekday } from "../utils";

/**
 * WeekdayDisplay 组件 Props
 */

/**
 * 星期展示组件
 *
 * @description
 * - 格式化并展示星期
 * - 支持完整/缩写/单字母模式
 * - 自动支持中英文
 *
 * @example
 * // 默认（缩写）
 * <WeekdayDisplay
 *   weekday={dayjs()}
 *   format={{ full: false, singleLetter: false }}
 *   style={{ fontSize: 18, fontWeight: 400, color: '#666' }}
 * />
 * // => "Sat" / "周六"
 *
 * // 完整
 * <WeekdayDisplay
 *   weekday={dayjs()}
 *   format={{ full: true }}
 * />
 * // => "Saturday" / "星期六"
 *
 * // 单字母
 * <WeekdayDisplay
 *   weekday={dayjs()}
 *   format={{ singleLetter: true }}
 * />
 * // => "S" / "六"
 */
export var WeekdayDisplay = function WeekdayDisplay(_ref) {
  var weekday = _ref.weekday,
    format = _ref.format,
    style = _ref.style,
    className = _ref.className;
  // 格式化星期
  var formattedWeekday = formatWeekday(weekday, format);

  // 构建样式
  var inlineStyle = {
    fontSize: style === null || style === void 0 ? void 0 : style.fontSize,
    fontWeight: style === null || style === void 0 ? void 0 : style.fontWeight,
    color: style === null || style === void 0 ? void 0 : style.color,
    lineHeight: style === null || style === void 0 ? void 0 : style.lineHeight
  };
  return /*#__PURE__*/React.createElement("span", {
    className: "pisell-datetime-display-weekday ".concat(className || '').trim(),
    style: inlineStyle
  }, formattedWeekday);
};
export default WeekdayDisplay;