UNPKG

@helpwave/hightide

Version:

helpwave's component and theming library

25 lines (22 loc) 1.04 kB
import * as react from 'react'; import { PropsWithChildren } from 'react'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { LoadingAnimationProps } from './LoadingAnimation.js'; import { ErrorComponentProps } from './ErrorComponent.js'; import '../hooks/useTranslation.js'; import '../hooks/useLanguage.js'; 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 };