import{r as h,j as e,T as s,R as m}from"./index-6f149d0c.js";import{L as p}from"./Link-ac51a1d2.js";import{D as x}from"./Dialog-4a8f5dd6.js";import{D as g}from"./DialogTitle-0edc620d.js";import{D as j}from"./DialogContent-398aea0b.js";import{D}from"./DialogActions-d3c730f9.js";const R=({text:i,maxLength:o,readMoreText:l="Read more",dialogTitle:t="Full Text"})=>{const[a,r]=h.useState(!1),d=()=>{r(!0)},n=()=>{r(!1)};if(i.length<=o)return e.jsx(s,{sx:{lineHeight:1.2,height:"2.4em",minHeight:"2.4em"},children:i});const c=i.slice(0,o);return e.jsxs(e.Fragment,{children:[e.jsxs(s,{sx:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:1.2,height:"2.4em"},children:[c,i.length>o&&"... ",e.jsx(p,{component:"button",variant:"body2",onClick:d,sx:{cursor:"pointer"},children:l})]}),e.jsxs(x,{open:a,onClose:n,maxWidth:"md",fullWidth:!0,children:[e.jsx(g,{children:t}),e.jsx(j,{children:e.jsx(s,{sx:{wordBreak:"break-word"},children:i})}),e.jsx(D,{children:e.jsx(m,{onClick:n,children:"Close"})})]})]})};export{R};
