|
Download wp-calypso/client/components/confirm-modal/README.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/confirm-modal/README.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/confirm-modal/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/confirm-modal/README.md
1.16 kB
ConfirmModal Component
The ConfirmModal component is a reusable component that provides a confirmation dialog with customizable buttons and text.
Usage
Import the ConfirmModal component in your project:
import ConfirmModal from './ConfirmModal';
The ConfirmModal component accepts the following props:
isVisible: Whether the modal is visible or not.cancelButtonLabel(optional): Label or content for the cancel button.confirmButtonLabel(optional): Label or content for the confirm button.text(optional): Additional text to display in the modal.title: Title of the confirmation modal.onCancel: Callback function to handle the cancel button click event.onConfirm: Callback function to handle the confirm button click event.
Example usage
<ConfirmModal
isVisible={isVisible}
cancelButtonLabel="Cancel"
confirmButtonLabel="Confirm"
text="Are you sure you want to proceed?"
title="Confirmation"
onCancel={handleCancel}
onConfirm={handleConfirm}
/>
Make sure to define the handleCancel and handleConfirm functions in your code to handle the respective button click events.