Files
sigpro-ui/components/swap.js
natxocc 59e6d972a8
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
changed to new functions
2026-04-22 12:06:34 +02:00

14 lines
482 B
JavaScript

// components/Swap.js
import { h } from "sigpro";
export const Swap = (props) => {
return h("label", { ...props, class: `swap ${props.class ?? ''}` }, [
h("input", {
type: "checkbox",
checked: () => typeof props.value === "function" ? props.value() : props.value,
onchange: (e) => typeof props.value === "function" && props.value(e.target.checked)
}),
h("div", { class: "swap-on" }, props.on),
h("div", { class: "swap-off" }, props.off)
]);
};