insomnia/packages/insomnia-app/app/ui/components/grpc-spinner.tsx
2021-07-23 11:04:56 +12:00

17 lines
464 B
TypeScript

import classnames from 'classnames';
import React, { FunctionComponent } from 'react';
import { useGrpcRequestState } from '../context/grpc';
interface Props {
className?: string;
requestId: string;
}
const GrpcSpinner: FunctionComponent<Props> = ({ className, requestId }) => {
const { running } = useGrpcRequestState(requestId);
return running ? <i className={classnames('fa fa-refresh fa-spin', className)} /> : null;
};
export default GrpcSpinner;