@@ -65,6 +65,7 @@ import { UserProfilePhoto } from "../UserProfilePhoto";
6565import  {  FreePlanUsage  }  from  "../billing/v2/FreePlanUsage" ; 
6666import  {  Badge  }  from  "../primitives/Badge" ; 
6767import  {  LinkButton  }  from  "../primitives/Buttons" ; 
68+ import  {  Header2  }  from  "../primitives/Headers" ; 
6869import  {  Paragraph  }  from  "../primitives/Paragraph" ; 
6970import  { 
7071  Popover , 
@@ -91,6 +92,34 @@ type SideMenuProps = {
9192  defaultValue ?: FeedbackType ; 
9293} ; 
9394
95+ function  V2Countdown ( )  { 
96+   const  [ days ,  setDays ]  =  useState ( 0 ) ; 
97+ 
98+   useEffect ( ( )  =>  { 
99+     const  targetDate  =  new  Date ( "2025-01-31T00:00:00Z" ) ; 
100+ 
101+     const  calculateDays  =  ( )  =>  { 
102+       const  now  =  new  Date ( ) ; 
103+       const  difference  =  targetDate . getTime ( )  -  now . getTime ( ) ; 
104+       return  Math . floor ( difference  /  ( 1000  *  60  *  60  *  24 ) ) ; 
105+     } ; 
106+ 
107+     const  timer  =  setInterval ( ( )  =>  { 
108+       setDays ( calculateDays ( ) ) ; 
109+     } ,  1000  *  60  *  60 ) ;  // Update every hour 
110+ 
111+     setDays ( calculateDays ( ) ) ;  // Initial calculation 
112+ 
113+     return  ( )  =>  clearInterval ( timer ) ; 
114+   } ,  [ ] ) ; 
115+ 
116+   return  ( 
117+     < Header2  className = "flex-wrap gap-4 text-error" > 
118+       V2 goes offline in < span  className = "tabular-nums" > { days } d</ span > 
119+     </ Header2 > 
120+   ) ; 
121+ } 
122+ 
94123export  function  SideMenu ( {  user,  project,  organization,  organizations } : SideMenuProps )  { 
95124  const  borderRef  =  useRef < HTMLDivElement > ( null ) ; 
96125  const  [ showHeaderDivider ,  setShowHeaderDivider ]  =  useState ( false ) ; 
@@ -215,7 +244,8 @@ export function SideMenu({ user, project, organization, organizations }: SideMen
215244        </ div > 
216245        < div  className = "m-2" > 
217246          { project . version  ===  "V2"  &&  ( 
218-             < div  className = "flex flex-col gap-3 rounded border border-success/50 bg-success/10 p-3" > 
247+             < div  className = "flex flex-col gap-3 rounded border border-error/50 bg-error/5 p-3" > 
248+               < V2Countdown  /> 
219249              < Paragraph  variant = "small/bright" > 
220250                This is a v2 project. V2 will be deprecated on January 31, 2025.{ " " } 
221251                < TextLink 
0 commit comments