// Copyright 1999-2023. Plesk International GmbH. All rights reserved.

import classNames from 'classnames';
import { CLS_PREFIX } from '../../constants';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
/**
 * Figure component.
 * @since 0.0.42
 */
const Figure = _ref => {
  let {
    baseClassName = `${CLS_PREFIX}figure`,
    className,
    href,
    caption,
    children,
    ...props
  } = _ref;
  return /*#__PURE__*/_jsxs("figure", {
    className: classNames(baseClassName, className),
    ...props,
    children: [children, href && /*#__PURE__*/_jsx("a", {
      href: href,
      className: classNames(`${baseClassName}__overlay`, `${baseClassName}__overlay--cover`, `${baseClassName}__action`)
    }), caption && /*#__PURE__*/_jsx("figcaption", {
      className: classNames(`${baseClassName}__overlay`, `${baseClassName}__overlay--bottom`),
      children: caption
    })]
  });
};
export default Figure;