import{j as u,aL as g,aM as f,T as o,aN as d,am as c,ar as x,p as t,b as A}from"./mui-vendor-CkIVaoQP.js";import{r as T}from"./react-vendor-CmFgShSM.js";import{f as j,u as S}from"./redux-vendor-B7uoacJt.js";import{k,p as E,q as F,S as i,G as a,hV as P,kI as b}from"./index-Cr86_nOs.js";import{M as D}from"./MessagesSenders-B350AShH.js";const m=({heading:n,message:r,linkText:l,link:s,image:e,time:p,number:h})=>u.jsxs(g,{children:[u.jsx(f,{expandIcon:u.jsx(k,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:u.jsx(o,{children:n?h+1+" - "+n:h+1+" بدون عنوان "})}),u.jsx(d,{children:u.jsxs(o,{color:"primary",textAlign:"justify",children:[r||"برای این پیغام توضیحی نوشته نشده است",u.jsx("hr",{}),u.jsxs(o,{mt:i.SMALL,textAlign:"justify",children:["تاریخ ثبت پیام: ",E(p)," - ساعت ",F(p)]})]})}),l&&u.jsxs(u.Fragment,{children:[u.jsx(c,{textAlign:"left",children:u.jsx(x,{label:"پیوند"})}),u.jsx(d,{children:u.jsx("a",{style:{textDecoration:"none"},href:s,children:l})})]}),e!=null&&e.length?u.jsx(c,{textAlign:"left",children:u.jsx(x,{label:"تصاویر"})}):"",e!=null&&e.length?e.map((C,y)=>[u.jsx(a,{display:"inline-block",p:i.SMALL,children:u.jsx("a",{href:C,children:u.jsx("img",{src:C,alt:"Slaughter Payment Factor",width:"100"})},"SlaughterPaymentFactorImage")},y)]):""]});m.propTypes={message:t.PropTypes.string,heading:t.PropTypes.string,link:t.PropTypes.string,linkText:t.PropTypes.string,image:t.PropTypes.any,time:t.PropTypes.string,number:t.PropTypes.any};const B=()=>{const{senderMessages:n}=j(s=>s.messageSlice),{reciverMessages:r}=j(s=>s.messageSlice),l=S();return T.useEffect(()=>{l(P()),l(b())},[]),u.jsx(u.Fragment,{children:u.jsx(A,{display:"flex",justifyContent:"center",children:u.jsxs(a,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsxs(a,{justifyContent:"center",my:i.MEDIUM,children:[!(n!=null&&n.length)&&!(r!=null&&r.length)&&u.jsx(o,{variant:"body1",color:"primary",children:"در حال حاضر پیامی جهت نمایش وجود ندارد!"}),n!=null&&n.length?u.jsx(c,{children:u.jsx(x,{label:"پیام های همگانی"})}):"",u.jsx(a,{p:i.SMALL,children:n==null?void 0:n.map((s,e)=>u.jsx(D,{number:e,heading:s.heading,message:s.message,link:s.link,linkText:s.linkText,image:s.image,time:s.time},e))})]}),u.jsxs(a,{justifyContent:"center",children:[r!=null&&r.length?u.jsx(c,{children:u.jsx(x,{label:"پیام های شما"})}):"",u.jsx(a,{p:i.SMALL,children:r==null?void 0:r.map((s,e)=>u.jsx(m,{number:e,heading:s.heading,message:s.message,link:s.link,linkText:s.linkText,image:s.image,time:s.time},e))})]})]})})})};export{B as default};
