aboutsummaryrefslogtreecommitdiff
path: root/users/ryan/modules/simple-bar/simple-bar-source/lib/components/data/data-widget-loader.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/components/data/data-widget-loader.jsx')
-rwxr-xr-xusers/ryan/modules/simple-bar/simple-bar-source/lib/components/data/data-widget-loader.jsx37
1 files changed, 37 insertions, 0 deletions
diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/components/data/data-widget-loader.jsx b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/data/data-widget-loader.jsx
new file mode 100755
index 0000000..4115024
--- /dev/null
+++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/data/data-widget-loader.jsx
@@ -0,0 +1,37 @@
1import * as Uebersicht from "uebersicht";
2import * as Utils from "../../utils";
3
4export { dataWidgetLoaderStyles as styles } from "../../styles/components/data/data-widget-loader";
5
6const { React } = Uebersicht;
7
8/**
9 * A memoized React component that renders a data widget loader.
10 *
11 * @param {Object} props - The properties object.
12 * @param {number} [props.width=14] - The width of the loader.
13 * @param {number} [props.height=14] - The height of the loader.
14 * @param {string} [props.className] - Additional class names for the loader.
15 * @param {Object} [props.style] - Additional styles for the loader.
16 * @returns {JSX.Element} The rendered data widget loader component.
17 */
18export const Widget = React.memo(
19 ({ width = 14, height = 14, className, style }) => {
20 // Generate class names using the Utils.classNames function
21 const classes = Utils.classNames("data-widget-loader", "data-widget", {
22 [className]: className,
23 });
24
25 // Return the JSX for the data widget loader
26 return (
27 <div className={classes} style={style}>
28 <div
29 className="data-widget-loader__inner"
30 style={{ width, height, flex: `0 0 ${width || height}px` }}
31 />
32 </div>
33 );
34 },
35);
36
37Widget.displayName = "DataWidgetLoader";