Elffuss BraidHub

kikocis/continue public

main · 866 BRawPermalink
1import { Box, Text } from "ink";
2import React from "react";
3
4import { LoadingAnimation } from "../LoadingAnimation.js";
5import { Timer } from "../Timer.js";
6
7interface ActionStatusProps {
8 visible: boolean;
9 startTime: number;
10 message: string;
11 showSpinner?: boolean;
12 color?: string;
13 loadingColor?: string;
14}
15
16const ActionStatus: React.FC<ActionStatusProps> = ({
17 visible,
18 startTime,
19 message,
20 showSpinner = false,
21 color = "dim",
22 loadingColor = "green",
23}) => {
24 if (!visible) return null;
25
26 return (
27 <Box paddingX={1} flexDirection="row" gap={1}>
28 {showSpinner && <LoadingAnimation color={loadingColor} visible={true} />}
29 <Text color={color}>{message}</Text>
30 <Text color="dim">(</Text>
31 <Timer startTime={startTime} />
32 <Text color="dim">• esc to interrupt )</Text>
33 </Box>
34 );
35};
36
37export { ActionStatus };