1+ import { SheetNavigationButtons } from "@/components/sheetNavigationButtons" ;
12import { Badge } from "@/components/ui/badge" ;
23import { Label } from "@/components/ui/label" ;
34import { Progress } from "@/components/ui/progress" ;
@@ -17,11 +18,12 @@ import {
1718 TableHeader ,
1819 TableRow ,
1920} from "@/components/ui/table" ;
21+ import { useSheetNavigation } from "@/hooks/useSheetNavigation" ;
22+ import { supportsCalendarAlignment } from "@/lib/constants/governance" ;
2023import { ProviderIconType , RenderProviderIcon } from "@/lib/constants/icons" ;
2124import { ProviderLabels , ProviderName } from "@/lib/constants/logs" ;
2225import { VirtualKey } from "@/lib/types/governance" ;
2326import { cn } from "@/lib/utils" ;
24- import { supportsCalendarAlignment } from "@/lib/constants/governance" ;
2527import {
2628 calculateUsagePercentage ,
2729 formatCurrency ,
@@ -83,11 +85,17 @@ function UsageLine({
8385interface VirtualKeyDetailSheetProps {
8486 virtualKey : VirtualKey ;
8587 onClose : ( ) => void ;
88+ onNavigate ?: ( direction : "prev" | "next" ) => void ;
89+ hasPrev ?: boolean ;
90+ hasNext ?: boolean ;
8691}
8792
8893export default function VirtualKeyDetailSheet ( {
8994 virtualKey,
9095 onClose,
96+ onNavigate,
97+ hasPrev = false ,
98+ hasNext = false ,
9199} : VirtualKeyDetailSheetProps ) {
92100 const {
93101 assignedUsers,
@@ -98,6 +106,13 @@ export default function VirtualKeyDetailSheet({
98106 displayRateLimit,
99107 } = useVirtualKeyUsage ( virtualKey ) ;
100108
109+ const { prev : prevKeys , next : nextKeys } = useSheetNavigation ( {
110+ enabled : true ,
111+ hasPrev,
112+ hasNext,
113+ onNavigate : ( direction ) => onNavigate ?.( direction ) ,
114+ } ) ;
115+
101116 const getEntityInfo = ( ) => {
102117 if ( virtualKey . team ) {
103118 return { type : "Team" , name : virtualKey . team . name } ;
@@ -117,21 +132,30 @@ export default function VirtualKeyDetailSheet({
117132 ( displayRateLimit ?. token_current_usage &&
118133 displayRateLimit ?. token_max_limit &&
119134 displayRateLimit . token_current_usage >=
120- displayRateLimit . token_max_limit ) ||
135+ displayRateLimit . token_max_limit ) ||
121136 ( displayRateLimit ?. request_current_usage &&
122137 displayRateLimit ?. request_max_limit &&
123138 displayRateLimit . request_current_usage >=
124- displayRateLimit . request_max_limit ) ;
139+ displayRateLimit . request_max_limit ) ;
125140
126141 return (
127142 < Sheet open onOpenChange = { onClose } >
128143 < SheetContent className = "flex w-full flex-col overflow-x-hidden p-8 sm:max-w-2xl" >
129- < SheetHeader className = "flex flex-col items-start p-0" >
130- < SheetTitle > { virtualKey . name } </ SheetTitle >
131- < SheetDescription >
132- { virtualKey . description ||
133- "Virtual key details and usage information" }
134- </ SheetDescription >
144+ < SheetHeader className = "flex flex-row items-center justify-between p-0" >
145+ < div className = "flex flex-col items-start" >
146+ < SheetTitle > { virtualKey . name } </ SheetTitle >
147+ < SheetDescription >
148+ { virtualKey . description || "Virtual key details and usage information" }
149+ </ SheetDescription >
150+ </ div >
151+ < SheetNavigationButtons
152+ hasPrev = { hasPrev }
153+ hasNext = { hasNext }
154+ onNavigate = { ( dir ) => onNavigate ?.( dir ) }
155+ prevKeys = { prevKeys }
156+ nextKeys = { nextKeys }
157+ entityLabel = "virtual key"
158+ />
135159 </ SheetHeader >
136160
137161 < div className = "space-y-6" >
@@ -223,7 +247,7 @@ export default function VirtualKeyDetailSheet({
223247
224248 < div className = "space-y-3" >
225249 { ! virtualKey . provider_configs ||
226- virtualKey . provider_configs . length === 0 ? (
250+ virtualKey . provider_configs . length === 0 ? (
227251 < span className = "text-muted-foreground text-sm" >
228252 No providers configured (deny-by-default)
229253 </ span >
@@ -503,7 +527,7 @@ export default function VirtualKeyDetailSheet({
503527
504528 < div className = "space-y-3" >
505529 { ! virtualKey . mcp_configs ||
506- virtualKey . mcp_configs . length === 0 ? (
530+ virtualKey . mcp_configs . length === 0 ? (
507531 < span className = "text-muted-foreground text-sm" >
508532 No MCP clients configured (deny-by-default)
509533 </ span >
0 commit comments