From 3022a084bea0f32a69d925f84be0a792a5dd4396 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 1 Oct 2025 16:18:36 +0800 Subject: [PATCH] Added function on modal button --- src/components/Modal/ModalButton.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Modal/ModalButton.tsx b/src/components/Modal/ModalButton.tsx index 7153a17..ac5ff10 100644 --- a/src/components/Modal/ModalButton.tsx +++ b/src/components/Modal/ModalButton.tsx @@ -14,12 +14,16 @@ interface Props { width?: number wide?: boolean class?: string + function?: () => Promise } export default (props: Props) => { const [isOpen, setIsOpen] = createSignal(false) - const openHandler = () => { + const openHandler = async () => { + if (props.function) { + await props.function() + } setIsOpen(true) } @@ -32,6 +36,7 @@ export default (props: Props) => {