mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
17 lines
427 B
React
17 lines
427 B
React
![]() |
import React from 'react';
|
||
|
import { Components, registerComponent } from 'meteor/vulcan:lib';
|
||
|
|
||
|
const DynamicLoading = ({ isLoading, pastDelay, error }) => {
|
||
|
if (isLoading && pastDelay) {
|
||
|
return <Components.Loading/>;
|
||
|
} else if (error && !isLoading) {
|
||
|
console.log(error)
|
||
|
return <p>Error!</p>;
|
||
|
} else {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
registerComponent('DynamicLoading', DynamicLoading);
|
||
|
|
||
|
export default DynamicLoading;
|