"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[913],{54913:function(e,t,n){n.r(t);var a=n(75948),o=n(83087),c=n(58127),s=n(75623),r=n(70547),u=n(64735),l=n.n(u);function LastUpdateTime(){let e=(0,c.useRouter)(),[t,n]=(0,s.useState)(0),[u,d]=(0,s.useState)(new Date);return(0,s.useEffect)(()=>{let createSocketConnection=async()=>{let t=(0,r.io)();t.on("connect",()=>{console.log("Watching for updates...")}),t.on("project-updated",l()(()=>{console.log("project updated"),e.refresh(),d(new Date)},500)),t.on("disconnect",()=>{console.log("Stopped watching for updates...")})};createSocketConnection()},[e]),(0,s.useEffect)(()=>{let e=setInterval(()=>{n(t+1),t>60&&clearInterval(e)},1e3);return()=>clearInterval(e)},[t]),(0,a.jsx)("div",{className:"text-muted-foreground text-xs",children:"Last updated ".concat((0,o.Z)(new Date,u))})}t.default=LastUpdateTime}}]);