import React, { Component } from "react";
import PropTypes from "prop-types";
import { observer } from "mobx-react";
import { observable, action } from "mobx";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faChevronUp } from "@fortawesome/free-solid-svg-icons/faChevronUp";
import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown";
import { AlertStore } from "Stores/AlertStore";
import { TooltipWrapper } from "Components/TooltipWrapper";
import { LabelWithPercent } from "Components/Labels/LabelWithPercent";
const TableRows = observer(({ alertStore, nameStats }) =>
nameStats.map(nameStats => (
|
{nameStats.hits}
{nameStats.name}
|
{nameStats.values.slice(0, 9).map((valueStats, i) => (
f.raw === valueStats.raw)
.length > 0
}
/>
))}
{nameStats.values.length > 9 ? (
+{nameStats.values.length - 9} more
) : null}
|
))
);
const LabelsTable = observer(
({ alertStore, showAllLabels, toggleAllLabels }) => (
nameStats.hits >= alertStore.info.totalAlerts
)}
>
{alertStore.data.counters.filter(
nameStats => nameStats.hits < alertStore.info.totalAlerts
).length > 0 ? (
|
|
) : null}
{showAllLabels ? (
nameStats.hits < alertStore.info.totalAlerts
)}
>
) : null}
)
);
const NothingToShow = () => (
No labels to display
);
const OverviewModalContent = observer(
class OverviewModalContent extends Component {
static propTypes = {
alertStore: PropTypes.instanceOf(AlertStore).isRequired,
onHide: PropTypes.func.isRequired
};
allLabels = observable(
{
show: false,
toggle() {
this.show = !this.show;
}
},
{
toggle: action.bound
}
);
render() {
const { alertStore, onHide } = this.props;
return (
Overview
{alertStore.data.counters.length === 0 ? (
) : (
)}
);
}
}
);
export { OverviewModalContent };