@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
2 lines (1 loc) • 1.6 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("@mui/material/Stack"),i=require("@mui/material/Typography"),r=require("./CommentCard.styles.js"),n=require("./components/TextHighlighter.js"),o=require("../CommentRichText/CommentRichTextBlock.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(a),c=l(i);exports.CommentCardContent=a=>{const{multiRowRef:i,expanded:l,expandable:d,onExpandClick:m,maxLines:x=3,message:h,attachments:u=[],tags:g=[],metadata:p,tagging:f=!1,onTagCancel:C,highlight:j,selected:y,replies:T=0,mode:v="plaintext",richTextConfig:k,onEditSave:b,onLayoutChange:q,t:L}=a,w=t.useMemo((()=>L(l?"readLess":"readMore")),[l,L]);return e.jsx(s.default,{direction:"column",children:"plaintext"===v?e.jsxs(e.Fragment,{children:[e.jsx(c.default,{ref:i,variant:"caption",sx:[l?{}:r.styles.truncate,{fontSize:12,WebkitLineClamp:x<1?void 0:`${x}`,wordWrap:"break-word"}],children:e.jsx(n.TextHighlighter,{text:h,highlight:j})}),d&&e.jsx(c.default,{"data-testid":"show-more-text",variant:"caption",color:"primary",sx:{mx:0,mt:3,mb:.5,alignSelf:"flex-start",cursor:"pointer"},onClick:m,children:w}),e.jsx(s.default,{direction:"row",children:!y&&T>0&&e.jsx(c.default,{variant:"caption",sx:{display:"inline-block",mt:2,color:"text.secondary"},children:`${T} ${L(T>1?"replies":"reply")}`})})]}):e.jsx(o.CommentRichTextBlock,{data:h,replies:T,attachments:u,tags:g,metadata:p,tagging:f,onTagCancel:C,maxLines:x,highlight:j,selected:y,richTextConfig:k,onSave:b,onLayoutChange:q})})};