fleet/frontend/components/TableContainer/DataTable/LiveQueryIssueCell/LiveQueryIssueCell.tsx
Marko Lisica 8162d052bf
Icons improvements (making frontend consistent with Figma component library) (#14185)
# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [ ] Manual QA for all new/changed functionality

---------

Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2023-10-31 16:06:38 +00:00

63 lines
1.5 KiB
TypeScript

import React from "react";
import ReactTooltip from "react-tooltip";
import Icon from "components/Icon";
interface ILiveQueryIssueCellProps<T> {
displayName: string;
distributedInterval: number;
status: string;
rowId: number;
}
const LiveQueryIssueCell = ({
displayName,
distributedInterval,
status,
rowId,
}: ILiveQueryIssueCellProps<any>): JSX.Element => {
if (distributedInterval < 60 && status === "online") {
return <>{displayName}</>;
}
return (
<>
{displayName}{" "}
<span
className={`host-issue tooltip tooltip__tooltip-icon`}
data-tip
data-for={`host-issue__${rowId.toString()}`}
data-tip-disable={false}
>
<Icon
name="error-outline"
size="small"
color={status === "offline" ? "status-error" : "status-warning"}
/>
</span>
<ReactTooltip
place="top"
effect="solid"
backgroundColor="#3e4771"
id={`host-issue__${rowId.toString()}`}
data-html
>
<span className={`tooltip__tooltip-text`}>
{status === "offline" ? (
<>
Offline hosts will not <br />
respond to a live query.
</>
) : (
<>
This host might take up to
<br /> {distributedInterval} seconds to respond.
</>
)}
</span>
</ReactTooltip>
</>
);
};
export default LiveQueryIssueCell;