Rebuild all components
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
This commit is contained in:
@@ -2,26 +2,19 @@
|
||||
import { Tag } from "sigpro";
|
||||
|
||||
export const Stats = (props, children) => {
|
||||
const { class: className, vertical = false, ...rest } = props;
|
||||
const direction = vertical ? "stats-vertical" : "stats-horizontal";
|
||||
return Tag("div", {
|
||||
...rest,
|
||||
class: `stats ${direction} ${className || ''}`.trim()
|
||||
}, children);
|
||||
children === undefined && (children = props, props = {});
|
||||
const direction = props.vertical ? "stats-vertical" : "stats-horizontal";
|
||||
return Tag("div", { ...props, class: `stats ${direction} ${props.class ?? ''}`.trim() }, children);
|
||||
};
|
||||
|
||||
export const Stat = (props) => {
|
||||
const { class: className, label, value, desc, icon, actions, children, ...rest } = props;
|
||||
|
||||
if (children !== undefined) {
|
||||
return Tag("div", { ...rest, class: `stat ${className || ''}`.trim() }, children);
|
||||
}
|
||||
|
||||
return Tag("div", { ...rest, class: `stat ${className || ''}`.trim() }, [
|
||||
icon && Tag("div", { class: "stat-figure" }, icon),
|
||||
label && Tag("div", { class: "stat-title" }, label),
|
||||
value && Tag("div", { class: "stat-value" }, value),
|
||||
desc && Tag("div", { class: "stat-desc" }, desc),
|
||||
actions && Tag("div", { class: "stat-actions" }, actions)
|
||||
export const Stat = (props, children) => {
|
||||
children === undefined && (children = props, props = {});
|
||||
return Tag("div", { ...props, class: `stat ${props.class ?? ''}` }, [
|
||||
props.icon && Tag("div", { class: "stat-figure" }, props.icon),
|
||||
props.label && Tag("div", { class: "stat-title" }, props.label),
|
||||
props.value && Tag("div", { class: "stat-value" }, props.value),
|
||||
props.desc && Tag("div", { class: "stat-desc" }, props.desc),
|
||||
props.actions && Tag("div", { class: "stat-actions" }, props.actions),
|
||||
children
|
||||
]);
|
||||
};
|
||||
Reference in New Issue
Block a user