Sha256: ff04e4d340b2ce0a0583be63f30a5fb2df0c5c74db3c69db0bfbbfc8ba5c03ed

Contents?: true

Size: 752 Bytes

Versions: 6

Compression:

Stored size: 752 Bytes

Contents

/* @flow */

import React from 'react'
import { uniqueId } from 'lodash'
import { Alert } from 'react-bootstrap'

/**
* Errors
* Displays the given {@messages} in a list format, inside a red alert box.
*
* @param {Array<String>} props.messages The error messages to be displayed
*/

type Props = {
  messages: Array<string>,
}

export default class Errors extends React.Component<Props> {
  static defaultProps = {
    messages: ["Something went wong"]
  }
  props: Props
  render() {
    const { messages } = this.props
    return (
      <Alert
          bsStyle="danger"
          className="errors"
      >
        <ul>
          {messages.map(m => (
            <li key={uniqueId()}>{m}</li>
          ))}
        </ul>
      </Alert>
    )
  }
}

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
playbook_ui-2.7.2 components/Errors/Errors.jsx
playbook_ui-2.7.1 components/Errors/Errors.jsx
playbook_ui-2.7.0 components/Errors/Errors.jsx
playbook_ui-2.6.0 components/Errors/Errors.jsx
playbook_ui-2.5.0 components/Errors/Errors.jsx
nitro_sg-3.0.2 components/Errors/Errors.jsx