[web] ErrorView

This commit is contained in:
Jason 2016-06-25 09:52:49 +08:00
parent 2b7923b4f4
commit e400e9f513
3 changed files with 20 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react'
import _ from 'lodash' import _ from 'lodash'
import Nav from './FlowView/Nav' import Nav from './FlowView/Nav'
import { Request, Response, Error } from './FlowView/Messages' import { Request, Response, ErrorView as Error } from './FlowView/Messages'
import Details from './FlowView/Details' import Details from './FlowView/Details'
import Prompt from './Prompt' import Prompt from './Prompt'

View File

@ -152,3 +152,20 @@ export class Response extends Component {
} }
} }
} }
ErrorView.propTypes = {
flow: PropTypes.object.isRequired,
}
export function ErrorView({ flow }) {
return (
<section>
<div className="alert alert-warning">
{flow.error.msg}
<div>
<small>{formatTimeStamp(flow.error.timestamp)}</small>
</div>
</div>
</section>
)
}