import React, { useCallback } from 'react'; // @ts-ignore import Highlighter from 'react-highlight-words'; import { Icon, IconName, Button, LinkButton, Card } from '@grafana/ui'; import { AlertRule } from '../../types'; export interface Props { rule: AlertRule; search: string; onTogglePause: () => void; } const AlertRuleItem = ({ rule, search, onTogglePause }: Props) => { const ruleUrl = `${rule.url}?editPanel=${rule.panelId}&tab=alert`; const renderText = useCallback( (text) => ( ), [search] ); return ( {renderText(rule.name)} {renderText(rule.stateText)}{' '} for {rule.stateAge} {rule.info ? renderText(rule.info) : null} Edit alert ); }; export default AlertRuleItem;