(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4007],{91098:function(e,r,s){Promise.resolve().then(s.bind(s,50002))},50002:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return c}});var t=s(57437),a=s(80605),n=s(99376),i=s(2265),l=s(32660),o=s(21865),d=s(22383);function c(){var e,r;let{data:s,status:c}=(0,a.useSession)(),u=(0,n.useRouter)();return((0,i.useEffect)(()=>{if("loading"!==c){if(!s){u.push("/auth/login");return}if("tenant"!==s.user.role){u.push("/dashboard");return}(async()=>{try{let e=await d.OR.requestPermission();"granted"===e?console.log("Browser notifications enabled for tenant"):console.log("Browser notifications denied or not supported for tenant")}catch(e){console.error("Error requesting notification permission for tenant:",e)}})()}},[s,c,u]),"loading"===c)?(0,t.jsx)("div",{className:"min-h-screen bg-gradient-bg-light dark:bg-gradient-bg-dark flex items-center justify-center",children:(0,t.jsx)("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-purple-600 dark:border-purple-400"})}):s&&"tenant"===s.user.role?(0,t.jsxs)("div",{className:"h-screen bg-gradient-bg-light dark:bg-gradient-bg-dark flex flex-col",children:[(0,t.jsx)("div",{className:"bg-white/80 dark:bg-gray-900/80 backdrop-blur-[20px] border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:(0,t.jsx)("div",{className:"max-w-7xl mx-auto px-6 py-4",children:(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsxs)("button",{onClick:()=>{u.push("/tenant/dashboard")},className:"flex items-center space-x-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 transition-colors",children:[(0,t.jsx)(l.Z,{className:"w-5 h-5"}),(0,t.jsx)("span",{className:"font-medium",children:"Back to Dashboard"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)("div",{className:"w-10 h-10 bg-gradient-primary rounded-xl flex items-center justify-center",children:(0,t.jsxs)("span",{className:"text-white font-semibold text-lg",children:[null===(e=s.user.firstName)||void 0===e?void 0:e[0],null===(r=s.user.lastName)||void 0===r?void 0:r[0]]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100",children:"Messages"}),(0,t.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Communicate with your property manager"})]})]})]})})}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,t.jsx)(o.Z,{currentUserId:s.user.id,currentUserRole:s.user.role})})]}):null}}},function(e){e.O(0,[7349,9840,2971,2117,1744],function(){return e(e.s=91098)}),_N_E=e.O()}]);