@helpwave/hightide
Version:
helpwave's component and theming library
25 lines (22 loc) • 1.05 kB
text/typescript
import * as react from 'react';
import { PropsWithChildren } from 'react';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { LoadingAnimationProps } from './LoadingAnimation.mjs';
import { ErrorComponentProps } from './ErrorComponent.mjs';
import '../hooks/useTranslation.mjs';
import '../hooks/useLanguage.mjs';
type LoadingAndErrorComponentProps = PropsWithChildren<{
isLoading?: boolean;
hasError?: boolean;
loadingProps?: LoadingAnimationProps;
errorProps?: ErrorComponentProps;
/**
* in milliseconds
*/
minimumLoadingDuration?: number;
}>;
/**
* A Component that shows the Error and Loading animation, when appropriate and the children otherwise
*/
declare const LoadingAndErrorComponent: ({ children, isLoading, hasError, errorProps, loadingProps, minimumLoadingDuration }: LoadingAndErrorComponentProps) => string | number | boolean | react_jsx_runtime.JSX.Element | Iterable<react.ReactNode> | null | undefined;
export { LoadingAndErrorComponent, type LoadingAndErrorComponentProps };