PHP Classes

File: client/src/features/pages/user/ProfileHistory.tsx

Recommend this page to a friend!
  Classes of mohammad anzawi   PHP Wallet API and Application   client/src/features/pages/user/ProfileHistory.tsx   Download  
File: client/src/features/pages/user/ProfileHistory.tsx
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Wallet API and Application
Application to manage a wallet by calling an API
Author: By
Last change:
Date: 2 years ago
Size: 2,488 bytes
 

Contents

Class file image Download
import {observer} from "mobx-react-lite"; import {useStore} from "../../../app/stores/store"; import {useEffect} from "react"; function ProfileHistory() { const {userStore} = useStore() const {transactions} = userStore useEffect(() => { userStore.getUserTransaction() }, [userStore]) return ( <div className="bg-gray-500"> <div className="shadow-xl bg-white p-10"> <table className="min-w-full divide-y divide-gray-200"> <thead className="bg-gray-50"> <tr> <th scope="col" className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider" > Type </th> <th scope="col" className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider" > Amount </th> <th scope="col" className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider" > Status </th> </tr> </thead> <tbody className="bg-white divide-y divide-gray-200"> {transactions.map((transaction) => ( <tr key={transaction.uuid} className={`${transaction.status === 'pending' ? 'bg-yellow-100' : transaction.status === 'approved' ? 'bg-green-100' : 'bg-red-100'}`}> <td className="px-6 py-4 whitespace-nowrap"> {transaction.type} </td> <td className="px-6 py-4 whitespace-nowrap"> {transaction.amount} </td> <td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> {transaction.status} </td> </tr> ))} </tbody> </table> </div> </div> ) } export default observer(ProfileHistory);