mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
28 lines
639 B
TypeScript
28 lines
639 B
TypeScript
import * as React from 'react'
|
|
import { Text } from '@anthropic/ink'
|
|
import type { Theme } from '../../utils/theme.js'
|
|
|
|
type Props = {
|
|
char: string
|
|
index: number
|
|
glimmerIndex: number
|
|
messageColor: keyof Theme
|
|
shimmerColor: keyof Theme
|
|
}
|
|
|
|
export function ShimmerChar({
|
|
char,
|
|
index,
|
|
glimmerIndex,
|
|
messageColor,
|
|
shimmerColor,
|
|
}: Props): React.ReactNode {
|
|
const isHighlighted = index === glimmerIndex
|
|
const isNearHighlight = Math.abs(index - glimmerIndex) === 1
|
|
const shouldUseShimmer = isHighlighted || isNearHighlight
|
|
|
|
return (
|
|
<Text color={shouldUseShimmer ? shimmerColor : messageColor}>{char}</Text>
|
|
)
|
|
}
|