import React from "react"; import PropTypes from "prop-types"; import { Oval } from "./types/oval"; import { DualRing } from "./types/dual-ring"; import { Rombs } from "./types/rombs"; import { Track } from "./types/track"; import Text from "../text"; const Loader = (props) => { const { type, color, size, label, className, style, id, primary, theme, } = props; const svgRenderer = (type) => { switch (type) { case "oval": return ; case "dual-ring": return ; case "rombs": return ; case "track": return ; default: return ( {label} ); } }; return (
{svgRenderer(type)}
); }; Loader.propTypes = { /** Font color */ color: PropTypes.string, /** Type loader */ type: PropTypes.oneOf(["base", "oval", "dual-ring", "rombs", "track"]), /** Font size */ size: PropTypes.string, /** Text label */ label: PropTypes.string, /** Class name */ className: PropTypes.string, /** Accepts id */ id: PropTypes.string, /** Accepts css style */ style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), }; Loader.defaultProps = { type: "base", size: "40px", label: "Loading content, please wait.", }; export default Loader;