2025-10-07 10:28:35 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import Spinner from 'ink-spinner';
|
|
|
|
|
import { type ComponentProps, useEffect } from 'react';
|
2025-11-05 16:20:04 -08:00
|
|
|
import { debugState } from '../debug.js';
|
2025-10-07 10:28:35 -07:00
|
|
|
|
|
|
|
|
export type SpinnerProps = ComponentProps<typeof Spinner>;
|
|
|
|
|
|
|
|
|
|
export const CliSpinner = (props: SpinnerProps) => {
|
|
|
|
|
useEffect(() => {
|
2025-11-05 16:20:04 -08:00
|
|
|
debugState.debugNumAnimatedComponents++;
|
2025-10-07 10:28:35 -07:00
|
|
|
return () => {
|
2025-11-05 16:20:04 -08:00
|
|
|
debugState.debugNumAnimatedComponents--;
|
2025-10-07 10:28:35 -07:00
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return <Spinner {...props} />;
|
|
|
|
|
};
|