import{r as p,j as o,T as e,J as h}from"./index-d2b25495.js";import{L as m}from"./Link-0d6c8639.js";import{D as x,a as j}from"./DialogContent-cded694d.js";import{D as u}from"./DialogTitle-a145b392.js";import{D}from"./DialogActions-7c802cc8.js";const y=({text:s,maxLength:r,readMoreText:l="Read more",dialogTitle:a="Full Text"})=>{const[t,n]=p.useState(!1),c=()=>{n(!0)},i=()=>{n(!1)};if(s.length<=r)return o.jsx(e,{children:s});const d=s.slice(0,r);return o.jsxs(o.Fragment,{children:[o.jsxs(e,{children:[d,s.length>r&&"... ",o.jsx(m,{component:"button",variant:"body2",onClick:c,sx:{cursor:"pointer"},children:l})]}),o.jsxs(x,{open:t,onClose:i,maxWidth:"md",fullWidth:!0,children:[o.jsx(u,{children:a}),o.jsx(j,{children:o.jsx(e,{sx:{wordBreak:"break-word"},children:s})}),o.jsx(D,{children:o.jsx(h,{onClick:i,children:"Close"})})]})]})};export{y as R};
