forked from deephaven/web-client-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlerts.tsx
More file actions
27 lines (24 loc) · 702 Bytes
/
Copy pathAlerts.tsx
File metadata and controls
27 lines (24 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React, { Component, ReactElement } from 'react';
import classNames from 'classnames';
class Alerts extends Component {
static renderAlert(brand: string): ReactElement {
return (
<div key={brand} className={classNames('alert', `alert-${brand}`)}>
<strong>Well done!</strong>
You successfully read this {brand} alert message.
</div>
);
}
render(): ReactElement {
const alerts = ['success', 'info', 'warning', 'danger'].map(brand =>
Alerts.renderAlert(brand)
);
return (
<div>
<h2 className="ui-title">Alerts</h2>
<div style={{ padding: '1rem 0' }}>{alerts}</div>
</div>
);
}
}
export default Alerts;