insomnia/packages/insomnia-app/app/ui/components/grpc-spinner.tsx

15 lines
442 B
TypeScript
Raw Normal View History

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