File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/usage/rpc Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,18 @@ export default async function RPCUsage(props: {
6363 Number ( totalCounts . rateLimitedCount ) +
6464 Number ( totalCounts . overageCount ) ;
6565
66+ const peakRateDate = ( ( ) => {
67+ if ( peakRate . date ) {
68+ try {
69+ return format ( new Date ( `${ peakRate . date } Z` ) , "MMM d, HH:mm" ) ;
70+ } catch ( e ) {
71+ console . error ( "Error parsing peak rate date" , peakRate . date , e ) ;
72+ return null ;
73+ }
74+ }
75+ return null ;
76+ } ) ( ) ;
77+
6678 return (
6779 < div className = "container mx-auto space-y-8 py-6" >
6880 < div className = "flex flex-col gap-2" >
@@ -113,9 +125,7 @@ export default async function RPCUsage(props: {
113125 </ div >
114126 < p className = "mt-1 text-muted-foreground text-xs" >
115127 < ClockIcon className = "mr-1 inline h-3 w-3" />
116- { peakRate . date
117- ? format ( new Date ( `${ peakRate . date } Z` ) , "MMM d, HH:mm" )
118- : "No Requests in last 24 hours" }
128+ { peakRateDate ? peakRateDate : "No Requests in last 24 hours" }
119129 </ p >
120130 </ CardContent >
121131 </ Card >
You can’t perform that action at this time.
0 commit comments