/* * Busy view with spinning thing and a message. Designed for showing a spinner * in place of data while a fetch/processing in progress. */ import * as React from "react" import { Spinner, SpinnerSize } from 'office-ui-fabric-react/lib/Spinner' export interface Props extends React.DetailedHTMLProps, HTMLDivElement> { /* Something renderable like a string or an element. Children are rendered below the message. */ message?: React.ReactNode /* Spinner size, defaults to large. */ size?: SpinnerSize } const defaultStyle = { display: "flex", flexDirection: "column", alignContent: "center", alignItems: "center", justifyContent: "center", } /** Vertically and horizontally center the content spinner and message. */ export function BusyView(props: Props): JSX.Element { let { message, size, style, ...rest } = props style = Object.assign({}, defaultStyle, style) return (
{message ?
{message ? message : null}
: null } {props.children}
) } export default BusyView