From 7093261f8409cc17e52ddd341254c1f5dafab97c Mon Sep 17 00:00:00 2001 From: Sophia Dao Date: Wed, 17 Jul 2024 12:47:25 -0500 Subject: [PATCH] feat(modal): Add in prop for Close button text --- app/(prowler)/providers/page.tsx | 1 - components/ui/modal/Modal.tsx | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/(prowler)/providers/page.tsx b/app/(prowler)/providers/page.tsx index 60af8b9e49..edb487b987 100644 --- a/app/(prowler)/providers/page.tsx +++ b/app/(prowler)/providers/page.tsx @@ -27,7 +27,6 @@ export default function Providers() {

Modal body content

} - actionText="Save" onAction={onAction} /> diff --git a/components/ui/modal/Modal.tsx b/components/ui/modal/Modal.tsx index 7c18d750a6..1344ec9ecf 100644 --- a/components/ui/modal/Modal.tsx +++ b/components/ui/modal/Modal.tsx @@ -13,6 +13,7 @@ interface ModalProps { isOpen: boolean; onOpenChange: (isOpen: boolean) => void; body: React.ReactNode; + onCloseText?: string; actionText?: string; onAction?: () => void; isDismissable?: boolean; @@ -23,7 +24,8 @@ export const Modal: React.FC = ({ isOpen, onOpenChange, body, - actionText, + onCloseText = "Close", + actionText = "Save", onAction, isDismissable = true, }) => { @@ -46,7 +48,7 @@ export const Modal: React.FC = ({ {body} {hasActionButton && (