2021-05-12 06:35:00 +00:00
|
|
|
import classnames from 'classnames';
|
2021-07-22 23:04:56 +00:00
|
|
|
import React, { FunctionComponent } from 'react';
|
|
|
|
|
2021-05-12 06:35:00 +00:00
|
|
|
import { useGrpcRequestState } from '../context/grpc';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
className?: string;
|
|
|
|
requestId: string;
|
|
|
|
}
|
|
|
|
|
2021-09-27 13:47:22 +00:00
|
|
|
export const GrpcSpinner: FunctionComponent<Props> = ({ className, requestId }) => {
|
2021-05-12 06:35:00 +00:00
|
|
|
const { running } = useGrpcRequestState(requestId);
|
|
|
|
return running ? <i className={classnames('fa fa-refresh fa-spin', className)} /> : null;
|
|
|
|
};
|