import{r as p,j as o,T as e,K as h}from"./index-60a3c753.js";import{L as m}from"./Link-06c1146b.js";import{D as x,a as j}from"./DialogContent-89e21f2e.js";import{D as u}from"./DialogTitle-fe69da5c.js";import{D}from"./DialogActions-e754942c.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};
