import{r as p,j as o,T as e,K as h}from"./index-def636a4.js";import{L as m}from"./Link-bb09d70c.js";import{D as x,a as j}from"./DialogContent-0cb684b3.js";import{D as u}from"./DialogTitle-e2e75924.js";import{D}from"./DialogActions-c4045764.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};
