@churchapps/apphelper
Version:
Library of helper functions for React and NextJS ChurchApps
22 lines • 1.29 kB
JavaScript
"use client";
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { Dots } from "react-activity";
import "react-activity/dist/Dots.css";
export const Loading = (props) => {
const getContents = () => {
const text = (props.loadingText) ? props.loadingText : "Loading";
const color = (props.color) ? props.color : "#222";
let result = _jsxs(_Fragment, { children: [_jsx(Dots, { speed: 0.8, animating: true, size: 32, color: color }), _jsx("p", { style: { color: color }, children: text })] });
switch (props.size) {
case "sm":
result = _jsxs(_Fragment, { children: [_jsx(Dots, { speed: 0.8, animating: true, size: 20, color: color }), _jsx("p", { style: { fontSize: 12, color: color }, children: text })] });
break;
case "lg":
result = _jsxs(_Fragment, { children: [_jsx(Dots, { speed: 0.8, animating: true, size: 48, color: color }), _jsx("p", { style: { fontSize: 30, color: color }, children: text })] });
break;
}
return result;
};
return (_jsx("div", { id: "loading-component", style: { textAlign: "center", fontFamily: "Roboto" }, children: getContents() }));
};
//# sourceMappingURL=Loading.js.map