forked from M-Labs/web2019
Egor Savkin
abb472f0ea
TODO: * Add all other warnings for cards * Add crate level warnings * Add reminders to the bottom of the crate * Refactor crate mode selection (???) * Add resource consumers, instead of a bunch of nbrOccupiedSLots Signed-off-by: Egor Savkin <es@m-labs.hk>
29 lines
959 B
JavaScript
29 lines
959 B
JavaScript
import {OverlayTrigger} from "react-bootstrap";
|
|
import React from "react";
|
|
import {MaxLevel} from "./warnings";
|
|
|
|
|
|
export function Warnings({warnings}) {
|
|
const max_level = MaxLevel(warnings);
|
|
return (
|
|
<OverlayTrigger
|
|
placement="bottom"
|
|
trigger={['click', 'hover', 'focus']}
|
|
overlay={
|
|
({arrowProps, hasDoneInitialMeasure, show, ...props}) => (
|
|
<div className="k-popup-warning" {...props}>
|
|
{warnings.map((warning, _i) => {
|
|
return (
|
|
<p className="rule warning">
|
|
<i>{warning.message}</i>
|
|
</p>
|
|
)
|
|
})}
|
|
</div>)
|
|
}
|
|
rootClose
|
|
>
|
|
<img className="alert-warning" src={max_level.icon}/>
|
|
</OverlayTrigger>
|
|
)
|
|
} |