Build a reusable Modal dialog component in React.
Requirements:
- The modal should have an open and close state.
- Provide a button to open the modal.
- Provide a button inside the modal to close it.
- The modal should accept children as content.
- Should be reusable in different parts of the app.
- Focus on functionality over styling.
- The component should work out-of-the-box in a live React preview (e.g., CodeSandbox/Sandpack).