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

import classNames from 'classnames';
import { useContext } from 'react';
import { CLS_PREFIX } from '../../constants';
import VerticalContext from '../VerticalContext';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
export const SECTION_ITEM_BASE_CLASS_NAME = `${CLS_PREFIX}section-item`;

/**
 * `SectionItem` component is used for showing parameters and its values in [Section](#!/Section).
 * @since 0.0.54
 */
const SectionItem = _ref => {
  let {
    baseClassName = SECTION_ITEM_BASE_CLASS_NAME,
    className,
    children,
    title,
    actions = false,
    vertical,
    ...props
  } = _ref;
  const verticalContext = useContext(VerticalContext);
  return /*#__PURE__*/_jsxs("div", {
    className: classNames(baseClassName, {
      [`${baseClassName}--actions`]: actions,
      [`${baseClassName}--vertical`]: vertical === undefined ? verticalContext : vertical
    }, className),
    ...props,
    children: [title === undefined || title === null ? null : /*#__PURE__*/_jsx("div", {
      className: `${baseClassName}__title`,
      children: title
    }), /*#__PURE__*/_jsx("div", {
      className: `${baseClassName}__value`,
      children: children
    })]
  });
};
export default SectionItem;