"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _classnames = _interopRequireDefault(require("classnames"));
var _constants = require("../../constants");
var _jsxRuntime = require("react/jsx-runtime");
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.

/**
 * Figure component.
 * @since 0.0.42
 */
const Figure = _ref => {
  let {
    baseClassName = `${_constants.CLS_PREFIX}figure`,
    className,
    href,
    caption,
    children,
    ...props
  } = _ref;
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("figure", {
    className: (0, _classnames.default)(baseClassName, className),
    ...props,
    children: [children, href && /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
      href: href,
      className: (0, _classnames.default)(`${baseClassName}__overlay`, `${baseClassName}__overlay--cover`, `${baseClassName}__action`)
    }), caption && /*#__PURE__*/(0, _jsxRuntime.jsx)("figcaption", {
      className: (0, _classnames.default)(`${baseClassName}__overlay`, `${baseClassName}__overlay--bottom`),
      children: caption
    })]
  });
};
var _default = exports.default = Figure;