UNPKG

@brizy/ui

Version:
35 lines (34 loc) 1.03 kB
import React from "react"; import { getHexByColorType } from "../utils/colors"; import { BRZ_PREFIX } from "../constants"; export const getAlignStyles = (align) => { if (align) { const flexAlign = { left: "flex-start", center: "center", right: "flex-end", }; return { [`--${BRZ_PREFIX}-shape-text-align`]: flexAlign[align] }; } return {}; }; export const getColor = (hoverColor) => { if (hoverColor) { return { [`--${BRZ_PREFIX}-shape-text-hover-color`]: getHexByColorType(hoverColor) }; } }; export const getSize = (variableName, size) => { if (variableName && size) { return { [variableName]: `${size}px` }; } return {}; }; export const LoadingContent = ({ lines }) => { const linesElements = []; if (lines) { for (let i = 0; i < lines; i++) { linesElements.push(React.createElement("div", { key: i })); } } return React.createElement(React.Fragment, null, linesElements); };