{"size": 881, "ext": "js", "max_stars_repo_path": "src/components/alert/alert.component.js", "max_stars_repo_name": "AgustinSpahn/rolaguard_frontend", "max_stars_repo_stars_event_min_datetime": "2020-08-12T17:37:53.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-12T17:37:53.000Z", "max_issues_repo_path": "src/components/alert/alert.component.js", "max_issues_repo_name": "AgustinSpahn/rolaguard_frontend", "max_issues_repo_issues_event_min_datetime": "2020-05-26T13:44:48.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T12:26:40.000Z", "max_forks_repo_path": "src/components/alert/alert.component.js", "max_forks_repo_name": "AgustinSpahn/rolaguard_frontend", "max_forks_repo_forks_event_min_datetime": "2020-04-17T19:27:33.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-01T15:01:58.000Z"}
{"max_stars_count": 1, "max_issues_count": 18, "max_forks_count": 5, "avg_line_length": 28.4193548387, "max_line_length": 69, "alphanum_fraction": 0.551645857}
import * as React from 'react';
import { observer, inject } from "mobx-react"
import { Message } from 'semantic-ui-react'

@inject('alertStore')
@observer
class AlertComponent extends React.Component {

    handleDismmiss = () => {
        this.props.alertStore.hideAlert()
    }
    
    render() {
        const { alertData } = this.props.alertStore
    
        let className = `${ alertData.type } ${ alertData.position }`

        return (
            <Message 
                onDismiss={ this.handleDismmiss }
                icon={ alertData.icon ? alertData.icon : "" } 
                header={ alertData.title ? alertData.title : "" } 
                content={ alertData.body ? alertData.body : "" } 
                // list={ alertData.list ? alertData.list : [] }
                className={ className }
            />
        )
    }
}

export default AlertComponent