import * as React from 'react'; import { COMPONENT_MODE_CUSTOM, COMPONENT_MODE_EMPTY, COMPONENT_MODE_ERROR, COMPONENT_MODE_LOADING } from '../mmui-react-component'; /** * React Component to Overlay a parent Component with a mode indicator. * make sure when initiating the ComponentModeWindow instance, provide attributes: mode, hasEmptyMode, hasErrorMode, loadingGraphicUrl */ export interface MmuiBlueComponentModeProps { mode?: any; customIconClass?: string; customMessage?: string; } export const MmuiBlueComponentMode: React.FC = ({mode, customIconClass, customMessage}: MmuiBlueComponentModeProps) => { let content = null; if (mode === COMPONENT_MODE_CUSTOM) { let customClasses = "icon-xl mmui-mb-2"; if(customIconClass){ customClasses = customClasses + ` ${customIconClass}`; } content = (

{customMessage}

); } else if (mode === COMPONENT_MODE_LOADING) { content = (
); } else if (mode === COMPONENT_MODE_EMPTY) { content = (

No data available based on your selections

Try modifying any conflicting selections or reducing selections

); } else if (mode === COMPONENT_MODE_ERROR) { content = (

Something went wrong on our end

Try again with some changes

); } return content; }