Files
gemini-cli/packages/cli/src/ui/components/LoadingIndicator.tsx
T

33 lines
744 B
TypeScript
Raw Normal View History

2025-04-15 21:41:08 -07:00
import React from 'react';
import { Box, Text } from 'ink';
import Spinner from 'ink-spinner';
interface LoadingIndicatorProps {
2025-04-17 18:06:21 -04:00
isLoading: boolean;
currentLoadingPhrase: string;
elapsedTime: number;
2025-04-15 21:41:08 -07:00
}
2025-04-18 19:09:41 -04:00
export const LoadingIndicator: React.FC<LoadingIndicatorProps> = ({
2025-04-17 18:06:21 -04:00
isLoading,
currentLoadingPhrase,
elapsedTime,
2025-04-15 21:41:08 -07:00
}) => {
2025-04-17 18:06:21 -04:00
if (!isLoading) {
return null; // Don't render anything if not loading
}
2025-04-15 21:41:08 -07:00
2025-04-17 18:06:21 -04:00
return (
<Box marginTop={1} paddingLeft={0}>
<Box marginRight={1}>
<Spinner type="dots" />
</Box>
<Text color="cyan">
{currentLoadingPhrase} ({elapsedTime}s)
</Text>
<Box flexGrow={1}>{/* Spacer */}</Box>
<Text color="gray">(ESC to cancel)</Text>
</Box>
);
2025-04-15 21:41:08 -07:00
};