import React from "react"; import classnames from "classnames"; import ReactTooltip from "react-tooltip"; interface IPillCellProps { value: [string, number]; } const generateClassTag = (rawValue: string): string => { return rawValue.replace(" ", "-").toLowerCase(); }; const PillCell = (props: IPillCellProps): JSX.Element => { const { value } = props; const pillClassName = classnames( "data-table__pill", `data-table__pill--${generateClassTag(value[0])}` ); const disable = () => { switch (value[0]) { case "Minimal": return false; case "Considerate": return false; case "Excessive": return false; case "Denylisted": return false; default: return true; } }; const tooltipText = () => { switch (value[0]) { case "Minimal": return ( <> Running this query very
frequently has little to no
impact on your device’s
performance. ); case "Considerate": return ( <> Running this query
frequently can have a
noticeable impact on your
device’s performance. ); case "Excessive": return ( <> Running this query, even
infrequently, can have a
significant impact on your
device’s performance. ); case "Denylisted": return ( <> This query has been
stopped from running
because of excessive
resource consumption. ); default: return null; } }; return ( <>
{value[0]}
{tooltipText()} ); }; export default PillCell;