-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web-scraping): render tracker name with indicators for scheduled…
… checks and notifications
- Loading branch information
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/pages/workspace/utils/web_scraping/web_page_tracker_name.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { EuiIcon, EuiText } from '@elastic/eui'; | ||
|
||
import type { WebPageTracker } from './web_page_tracker'; | ||
|
||
export function WebPageTrackerName({ tracker }: { tracker: WebPageTracker }) { | ||
if (!tracker.jobConfig) { | ||
return tracker.name; | ||
} | ||
|
||
const timeIcon = <EuiIcon type={'timeRefresh'} size="s" title={'Scheduled checks are enabled'} />; | ||
return tracker.jobConfig.notifications ? ( | ||
<EuiText size="s"> | ||
{tracker.name} {timeIcon} <EuiIcon type={'bell'} size="s" title={'Notifications are enabled'} /> | ||
</EuiText> | ||
) : ( | ||
<EuiText size="s"> | ||
{tracker.name} {timeIcon} | ||
</EuiText> | ||
); | ||
} |