(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5402],{37500:(e,s,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/sessions/[userId]/[sessionId]",function(){return l(44069)}])},44069:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>x});var t=l(74848),n=l(40851),i=l(81924),a=l(29080),r=l(72748),c=l(37399),o=l(86715),d=l(96540);let x=()=>{let e=(0,o.useRouter)(),{userId:s,sessionId:l}=e.query,[x,u]=(0,d.useState)(null),[f,h]=(0,d.useState)(!0),[m,j]=(0,d.useState)(null);return((0,d.useEffect)(()=>{let e=async()=>{if(l&&"string"==typeof l)try{h(!0),j(null);let e=await (0,i.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)(r.T,{className:"bg-foreground text-background",startContent:(0,t.jsx)(c.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)(a.o,{size:"lg"})}):(0,t.jsx)("div",{className:"flex-grow h-full",children:(0,t.jsx)(n.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)(a.o,{size:"lg"})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[8660,453,2327,1706,851,636,6593,8792],()=>s(37500)),_N_E=e.O()}]);