Replace hard-to-read gray text with 'dim' color which is more readable on both light and dark terminal backgrounds. This primarily affects: - Startup display: MCP prompt descriptions, model loading text, tips - Message rendering: user input, system messages, streaming indicators - Tool displays: result summaries, previews, diff output - Status displays: action status, timers, loading text The 'dim' color provides better contrast than 'gray' on light backgrounds while remaining subtle and unobtrusive on dark backgrounds. Generated with [Continue](https://continue.dev) Co-authored-by: Continue Agent <agent@continue.dev> Co-authored-by: Continue <noreply@continue.dev>
33 lines
635 B
TypeScript
33 lines
635 B
TypeScript
import { Text } from "ink";
|
|
import React, { useEffect, useState } from "react";
|
|
|
|
interface LoadingTextProps {
|
|
text: string;
|
|
color?: string;
|
|
interval?: number;
|
|
}
|
|
|
|
export const LoadingText: React.FC<LoadingTextProps> = ({
|
|
text,
|
|
color = "dim",
|
|
interval = 300,
|
|
}) => {
|
|
const [dotsCount, setDotsCount] = useState(1);
|
|
|
|
useEffect(() => {
|
|
const timer = setInterval(() => {
|
|
setDotsCount((current) => (current % 3) + 1);
|
|
}, interval);
|
|
|
|
return () => clearInterval(timer);
|
|
}, [interval]);
|
|
|
|
const dots = ".".repeat(dotsCount);
|
|
|
|
return (
|
|
<Text color={color}>
|
|
{text}
|
|
{dots}
|
|
</Text>
|
|
);
|
|
};
|