minusculas
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s

This commit is contained in:
2026-04-22 08:27:59 +02:00
parent 65d78ca215
commit 5a5f593025
63 changed files with 610 additions and 748 deletions

33
components/modal.js Normal file
View File

@@ -0,0 +1,33 @@
// components/Modal.js
import { Tag, Watch } from "sigpro";
export const Modal = (props) => {
let dialogRef = null;
Watch(() => {
const isOpen = typeof props.open === "function" ? props.open() : props.open;
if (!dialogRef) return;
isOpen ? dialogRef.showModal() : dialogRef.close();
});
const close = () => typeof props.open === "function" && props.open(false);
return Tag("dialog", {
...props,
ref: el => dialogRef = el,
class: `modal ${props.class ?? ''}`,
onclose: close,
oncancel: close
}, [
Tag("div", { class: "modal-box" }, [
props.title && Tag("h3", { class: "text-lg font-bold" }, props.title),
props.children,
Tag("div", { class: "modal-action" }, [
props.actions || Tag("button", { class: "btn", onclick: close }, "Cerrar")
])
]),
Tag("form", { method: "dialog", class: "modal-backdrop" }, [
Tag("button", {}, "close")
])
]);
};