(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5402],{46068:(e,s,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/sessions/[userId]/[sessionId]",function(){return l(91148)}])},91148:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>x});var t=l(37876),n=l(14107),i=l(22196),a=l(98594),r=l(89099),c=l(14232),o=l(21031),d=l(7700);let x=()=>{let e=(0,r.useRouter)(),{userId:s,sessionId:l}=e.query,[x,u]=(0,c.useState)(null),[f,h]=(0,c.useState)(!0),[m,j]=(0,c.useState)(null);return((0,c.useEffect)(()=>{let e=async()=>{if(l&&"string"==typeof l)try{h(!0),j(null);let e=await (0,d.Ht)(l);u(e)}catch(e){console.error("Error fetching session:",e),j("Failed to fetch session. Please try again.")}finally{h(!1)}};l&&e()},[l]),l&&s)?(0,t.jsxs)("div",{className:"flex flex-col gap-2 max-w-7xl w-full mx-auto pt-2 px-6 h-[calc(100vh-2rem)]",children:[(0,t.jsx)("header",{className:"mb-6",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h1",{className:"text-lg font-bold text-default-900 lg:text-2xl",children:"Session Chat"}),(0,t.jsxs)("p",{className:"text-small text-default-400 lg:text-medium",children:["Session ID: ",l]})]}),(0,t.jsx)(i.T,{className:"bg-foreground text-background",startContent:(0,t.jsx)(a.In,{icon:"lucide:arrow-left",width:16}),onPress:()=>e.push("/sessions/".concat(s)),children:"Back to Sessions"})]})}),m?(0,t.jsx)("div",{className:"flex justify-center items-center h-full",children:(0,t.jsx)("p",{className:"text-danger",children:m})}):f?(0,t.jsx)("div",{className:"flex justify-center items-center h-full",children:(0,t.jsx)(n.o,{size:"lg"})}):(0,t.jsx)("div",{className:"flex-grow h-full",children:(0,t.jsx)(o.A,{workflowID:null==x?void 0:x.workflow_id,sessionId:"string"==typeof l?l:void 0})})]}):(0,t.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,t.jsx)(n.o,{size:"lg"})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[2377,9235,9615,5806,1031,636,6593,8792],()=>s(46068)),_N_E=e.O()}]);