import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faSpinner } from '@fortawesome/free-solid-svg-icons' /* Import components here */ import { Overlay, StyledHideWhileLoading } from './hide-while-loading.styles' /* Import interfaces here */ import { HideWhileLoadingProps } from './hide-while-loading.interfaces' export const HideWhileLoading = ({ children, ...props }: HideWhileLoadingProps): JSX.Element => { const { isLoading, error } = props return ( {children} {(isLoading || error) && ( {!error ? : {error}} )} ) }