All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
14 lines
482 B
JavaScript
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)
|
|
]);
|
|
}; |