Download packages/cli/src/ui/components/CliSpinner.tsx from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 793 Bytes
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/components/CliSpinner.tsx
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/ui/components/CliSpinner.tsx
-
curl -L -o CliSpinner.tsx https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/components/CliSpinner.tsx
793 Bytes
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import Spinner from 'ink-spinner'; | |
| import { type ComponentProps, useEffect } from 'react'; | |
| import { debugState } from '../debug.js'; | |
| import { useSettings } from '../contexts/SettingsContext.js'; | |
| export type SpinnerProps = ComponentProps<typeof Spinner>; | |
| export const CliSpinner = (props: SpinnerProps) => { | |
| const settings = useSettings(); | |
| const shouldShow = settings.merged.ui?.showSpinner !== false; | |
| useEffect(() => { | |
| if (shouldShow) { | |
| debugState.debugNumAnimatedComponents++; | |
| return () => { | |
| debugState.debugNumAnimatedComponents--; | |
| }; | |
| } | |
| return undefined; | |
| }, [shouldShow]); | |
| if (!shouldShow) { | |
| return null; | |
| } | |
| return <Spinner {...props} />; | |
| }; | |