Implement a Transaction Details Modal Component
In a financial dashboard, users often need to view detailed information about specific transactions without navigating away from their current context. A modal dialog is a common and effective UI pattern for presenting such details. This problem focuses on building a robust, reusable, and accessible TransactionDetailsModal component that can display comprehensive information about a given transaction.
Your primary task is to implement the TransactionDetailsModal component based on the provided Transaction interface and mock data.
TransactionDetailsModal component: Implement the TransactionDetailsModal component that receives isOpen, onClose, and transaction as props.transaction object in a clear and readable format (e.g., ID, Amount, Status, Date, Customer Name, Payment Method).isOpen is true and close when isOpen is false.Escape key.TransactionDetailsModal component renders and displays the provided transaction data correctly.isOpen prop is true and is hidden when isOpen is false.onClose callback.Escape key closes the modal by triggering the onClose callback.onClose callback.role="dialog", aria-modal="true", aria-labelledby) and semantic HTML elements are used to enhance accessibility.Constraints
Transaction object as a prop; you do not need to fetch this data.App.tsx) will manage the modal's open/close state.TransactionDetailsModal component is structured, its reusability, and adherence to React best practices.Loading editor...