Modal dialogs are interactive overlay windows that temporarily disable the main content of a web page, focusing user attention on specific tasks or information. They serve various purposes, including displaying critical alerts, requesting user input, confirming actions, and presenting additional content without navigating away from the current context.
Build a reusable modal dialog component that can be opened and closed with customizable title and contents.
Design the necessary props or configuration options for the modal dialog based on the above requirements.
The <dialog>
HTML element is available but for the sake of practice, implement a modal dialog without using that element.