import { InfoICircleFill16OntintIcon } from '@cloudtower/icons-react';
import Icon from '../Icon/index.js';
import { Typo } from '../Typo/index.js';
import cs from 'classnames';
import React__default from 'react';
import { BasicBanner, ErrorBanner, InfoBanner, WarningBanner } from './banner.style.js';
import { Show } from '../../coreX/Show/index.js';

const Banner = ({
  message,
  type,
  btnProps,
  "data-testid": dataTestId
}) => {
  return /* @__PURE__ */ React__default.createElement("div", { "data-testid": dataTestId, id: "global-banner" }, /* @__PURE__ */ React__default.createElement(
    "div",
    {
      className: cs(Typo.Label.l3_bold, BasicBanner, {
        [ErrorBanner]: type === "error",
        [InfoBanner]: type === "info",
        [WarningBanner]: type === "warning"
      })
    },
    /* @__PURE__ */ React__default.createElement(Icon, { src: InfoICircleFill16OntintIcon }),
    /* @__PURE__ */ React__default.createElement("span", null, message),
    /* @__PURE__ */ React__default.createElement(Show, { condition: !(btnProps == null ? void 0 : btnProps.hide) }, /* @__PURE__ */ React__default.createElement(
      "span",
      {
        className: "dashed-btn",
        "data-testid": dataTestId ? `${dataTestId}-action` : void 0,
        onClick: btnProps == null ? void 0 : btnProps.onClick
      },
      btnProps == null ? void 0 : btnProps.text
    ))
  ));
};

export { Banner };
