@atlaskit/comment
Version:
A comment displays discussions and user feedback.
92 lines (91 loc) • 3.39 kB
JavaScript
/* comment.tsx generated by @compiled/babel-plugin v3.0.2 */
import _extends from "@babel/runtime/helpers/extends";
import "./comment.compiled.css";
import { ax, ix } from "@compiled/react/runtime";
import React from 'react';
import { cx } from '@atlaskit/css';
import { Box, Stack } from '@atlaskit/primitives/compiled';
import Footer from './footer';
import Header from './header';
import CommentLayout from './layout';
var textStyles = {
root: "_syazi7uo",
disabled: "_syaz1gmx"
};
/**
* __Comment__
*
* Comments enable discussions on an entity such as a page, blog post, work item, or pull request.
*/
var Comment = function Comment(_ref) {
var _ref$actions = _ref.actions,
actions = _ref$actions === void 0 ? [] : _ref$actions,
_ref$restrictedTo = _ref.restrictedTo,
restrictedTo = _ref$restrictedTo === void 0 ? '' : _ref$restrictedTo,
_ref$highlighted = _ref.highlighted,
highlighted = _ref$highlighted === void 0 ? false : _ref$highlighted,
_ref$isSaving = _ref.isSaving,
isSaving = _ref$isSaving === void 0 ? false : _ref$isSaving,
_ref$savingText = _ref.savingText,
savingText = _ref$savingText === void 0 ? 'Sending...' : _ref$savingText,
_ref$isError = _ref.isError,
isError = _ref$isError === void 0 ? false : _ref$isError,
_ref$errorActions = _ref.errorActions,
errorActions = _ref$errorActions === void 0 ? [] : _ref$errorActions,
_ref$errorIconLabel = _ref.errorIconLabel,
errorIconLabel = _ref$errorIconLabel === void 0 ? '' : _ref$errorIconLabel,
author = _ref.author,
avatar = _ref.avatar,
children = _ref.children,
content = _ref.content,
edited = _ref.edited,
time = _ref.time,
type = _ref.type,
testId = _ref.testId,
id = _ref.id,
afterContent = _ref.afterContent,
shouldRenderNestedCommentsInline = _ref.shouldRenderNestedCommentsInline,
_ref$headingLevel = _ref.headingLevel,
headingLevel = _ref$headingLevel === void 0 ? '3' : _ref$headingLevel,
shouldHeaderWrap = _ref.shouldHeaderWrap;
var headerProps = {
author: author,
edited: edited,
isError: isError,
isSaving: isSaving,
restrictedTo: restrictedTo,
savingText: savingText,
time: time,
type: type,
headingLevel: headingLevel,
shouldHeaderWrap: shouldHeaderWrap
};
var footerProps = {
actions: actions,
errorActions: errorActions,
errorIconLabel: errorIconLabel,
isError: isError,
isSaving: isSaving
};
return /*#__PURE__*/React.createElement(CommentLayout, {
testId: testId,
shouldRenderNestedCommentsInline: shouldRenderNestedCommentsInline,
id: id,
avatar: avatar,
content: /*#__PURE__*/React.createElement(Stack, {
space: "space.075"
}, /*#__PURE__*/React.createElement(Stack, {
space: "space.050"
}, /*#__PURE__*/React.createElement(Header, _extends({
testId: testId && "".concat(testId, "-header")
}, headerProps)), /*#__PURE__*/React.createElement(Box, {
testId: testId && "".concat(testId, "-content"),
xcss: cx(textStyles.root, (isSaving || isError) && textStyles.disabled)
}, content)), /*#__PURE__*/React.createElement(Footer, _extends({
testId: testId && "".concat(testId, "-footer")
}, footerProps)), afterContent),
highlighted: highlighted
}, children);
};
Comment.displayName = 'Comment';
export default Comment;