import { cx } from '@linaria/core';
import { Typo } from '../Typo/index.js';
import React__default from 'react';
import { BlankStateWrapper } from './style.js';
import Button from '../Button/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 SIZE_FONT_MAP = {
  large: {
    title: Typo.Display.d2_bold_title,
    desc: Typo.Label.l2_regular
  },
  medium: {
    title: Typo.Display.d3_bold_title,
    desc: Typo.Label.l3_regular
  },
  small: {
    title: Typo.Heading.h2_bold_title,
    desc: Typo.Label.l4_regular
  },
  area: {
    title: Typo.Heading.h2_bold_title,
    desc: Typo.Label.l4_regular
  },
  xSmall: {
    title: Typo.Heading.h2_regular_title
  }
};
const BlankState = (props) => {
  const {
    className,
    style,
    width,
    height,
    title,
    description,
    action,
    backgroundColor,
    size = "medium"
  } = props;
  const fontStyle = SIZE_FONT_MAP[size];
  const buttonSize = size === "large" || size === "medium" ? "middle" : "small";
  return /* @__PURE__ */ React__default.createElement(
    "div",
    {
      className: cx(className, BlankStateWrapper, size, backgroundColor),
      style: __spreadValues({
        width: typeof width === "number" ? `${width}px` : width,
        height: typeof height === "number" ? `${height}px` : height
      }, style || {})
    },
    /* @__PURE__ */ React__default.createElement("div", { className: cx("title", fontStyle.title) }, title),
    size !== "xSmall" && description ? /* @__PURE__ */ React__default.createElement("div", { className: cx("desc", fontStyle.desc) }, description) : null,
    action ? /* @__PURE__ */ React__default.createElement(
      Button,
      {
        type: "ordinary",
        size: buttonSize,
        className: cx("action-button", buttonSize),
        onClick: action.onClick
      },
      action.label
    ) : null
  );
};
var BlankState$1 = BlankState;

export { BlankState$1 as default };
