import {OverlayTrigger} from "react-bootstrap"; import React from "react"; import {Levels, MaxLevel} from "./warnings"; import {useShopStore} from "./shop_store"; import {compareArraysLevelOne} from "./utils"; export function CardWarnings({crate_index, card_index}) { const warnings = useShopStore(state => state.crates[crate_index].items[card_index].show_warnings, compareArraysLevelOne); const max_level = MaxLevel(warnings); return ( (
{warnings.map((warning, _i) => { return (

{warning.message}

) })}
) } rootClose >
) } export function WarningIndicator({crate_index, card_index}) { const warnings = useShopStore(state => state.crates[crate_index].items[card_index].show_warnings, compareArraysLevelOne); const max_level = MaxLevel(warnings); return max_level.priority === Levels.warning.priority ? ( ) : (); }