PHP Classes

File: client/src/features/components/ErrorSection.tsx

Recommend this page to a friend!
  Classes of mohammad anzawi   PHP Wallet API and Application   client/src/features/components/ErrorSection.tsx   Download  
File: client/src/features/components/ErrorSection.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: 1,341 bytes
 

Contents

Class file image Download
import React from "react"; import {useStore} from "../../app/stores/store"; import {observer} from "mobx-react-lite"; function ErrorSection() { const {errorsStore} = useStore() return ( <> {errorsStore.hasErrors && errorsStore.errors?.code !== 500 ? <div> <div className="bg-red-500 text-white font-bold rounded-t px-4 py-2"> </div> <div className="border border-t-0 border-red-400 rounded-b bg-red-100 px-4 py-3 text-red-700"> <ul> {errorsStore.getErrors()?.message.map(error => ( <li key={error}>{error}</li> ))} </ul> </div> </div> : errorsStore.hasErrors && errorsStore.errors?.code === 500 ? <div> <div className="bg-red-500 text-white font-bold rounded-t px-4 py-2"> </div> <div className="border border-t-0 border-red-400 rounded-b bg-red-100 px-4 py-3 text-red-700"> unknown error </div> </div>: null} </> ) } export default observer(ErrorSection)