import{r as p,j as o,T as e,K as h}from"./index-43bf7a1c.js";import{L as m}from"./Link-cc44beed.js";import{D as x,a as j}from"./DialogContent-d5902709.js";import{D as u}from"./DialogTitle-20dc6f66.js";import{D}from"./DialogActions-d63c6496.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};
