insomnia/packages/insomnia-app/app/ui/components/grpc-spinner.tsx
Dimitri Mitropoulos 5f4c19da35
[TypeScript] Phase 1 & 2 (#3370)
Co-authored-by: Opender Singh <opender.singh@konghq.com>
2021-05-12 18:35:00 +12:00

16 lines
463 B
TypeScript

import React, { FunctionComponent } from 'react';
import classnames from 'classnames';
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;