MCPcopy Index your code
hub / github.com/winfunc/opcode / ExecutionControlBar

Function ExecutionControlBar

src/components/ExecutionControlBar.tsx:19–102  ·  view source on GitHub ↗
({ 
  isExecuting, 
  onStop, 
  totalTokens = 0,
  elapsedTime = 0,
  className 
})

Source from the content-addressed store, hash-verified

17 * Provides stop functionality and real-time statistics
18 */
19export const ExecutionControlBar: React.FC<ExecutionControlBarProps> = ({
20 isExecuting,
21 onStop,
22 totalTokens = 0,
23 elapsedTime = 0,
24 className
25}) => {
26 // Format elapsed time
27 const formatTime = (seconds: number) => {
28 const mins = Math.floor(seconds / 60);
29 const secs = seconds % 60;
30 if (mins > 0) {
31 return `${mins}m ${secs.toFixed(0)}s`;
32 }
33 return `${secs.toFixed(1)}s`;
34 };
35
36 // Format token count
37 const formatTokens = (tokens: number) => {
38 if (tokens >= 1000) {
39 return `${(tokens / 1000).toFixed(1)}k`;
40 }
41 return tokens.toString();
42 };
43
44 return (
45 <AnimatePresence>
46 {isExecuting && (
47 <motion.div
48 initial={{ y: 100, opacity: 0 }}
49 animate={{ y: 0, opacity: 1 }}
50 exit={{ y: 100, opacity: 0 }}
51 transition={{ type: "spring", stiffness: 300, damping: 30 }}
52 className={cn(
53 "fixed bottom-6 left-1/2 -translate-x-1/2 z-50",
54 "bg-background/95 backdrop-blur-md border rounded-full shadow-lg",
55 "px-6 py-3 flex items-center gap-4",
56 className
57 )}
58 >
59 {/* Rotating symbol indicator */}
60 <div className="relative flex items-center justify-center">
61 <div className="rotating-symbol text-primary"></div>
62 </div>
63
64 {/* Status text */}
65 <span className="text-sm font-medium">Executing...</span>
66
67 {/* Divider */}
68 <div className="h-4 w-px bg-border" />
69
70 {/* Stats */}
71 <div className="flex items-center gap-4 text-xs text-muted-foreground">
72 {/* Time */}
73 <div className="flex items-center gap-1.5">
74 <Clock className="h-3.5 w-3.5" />
75 <span>{formatTime(elapsedTime)}</span>
76 </div>

Callers

nothing calls this directly

Calls 3

cnFunction · 0.90
formatTimeFunction · 0.70
formatTokensFunction · 0.70

Tested by

no test coverage detected