@elastic/eui
Version:
Elastic UI Component Library
37 lines (36 loc) • 1.49 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "className", "comments", "gutterSize"];
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import React from 'react';
import classNames from 'classnames';
import { EuiComment } from './comment';
import { EuiTimeline } from '../timeline';
import { jsx as ___EmotionJSX } from "@emotion/react";
export var EuiCommentList = function EuiCommentList(_ref) {
var children = _ref.children,
className = _ref.className,
comments = _ref.comments,
_ref$gutterSize = _ref.gutterSize,
gutterSize = _ref$gutterSize === void 0 ? 'l' : _ref$gutterSize,
rest = _objectWithoutProperties(_ref, _excluded);
var classes = classNames('euiCommentList', className);
var commentElements = null;
if (comments) {
commentElements = comments.map(function (item, index) {
return ___EmotionJSX(EuiComment, _extends({
key: index
}, item));
});
}
return ___EmotionJSX(EuiTimeline, _extends({
className: classes,
gutterSize: gutterSize
}, rest), commentElements, children);
};