feat: translate domain events in watchlistsList

This commit is contained in:
Maël Gangloff
2024-08-03 02:21:11 +02:00
parent ee47f9aac6
commit 9afaf11476
3 changed files with 42 additions and 35 deletions

View File

@@ -4,7 +4,7 @@ import {deleteWatchlist} from "../../utils/api";
import {DeleteFilled} from "@ant-design/icons";
import React from "react";
import useBreakpoint from "../../hooks/useBreakpoint";
import {actionToColor} from "../search/EventTimeline";
import {actionToColor, domainEvent} from "../search/EventTimeline";
import {Watchlist} from "../../pages/tracking/WatchlistPage";
const {useToken} = theme;
@@ -14,6 +14,8 @@ export function WatchlistsList({watchlists, onDelete}: { watchlists: Watchlist[]
const {token} = useToken()
const sm = useBreakpoint('sm')
const domainEventTranslated = domainEvent()
const columns = [
{
title: t`Domain names`,
@@ -49,7 +51,10 @@ export function WatchlistsList({watchlists, onDelete}: { watchlists: Watchlist[]
dataSource={[{
domains: watchlist.domains.map(d => <Tag>{d.ldhName}</Tag>),
events: watchlist.triggers?.filter(t => t.action === 'email')
.map(t => <Tag color={actionToColor(t.event)}>{t.event}</Tag>)
.map(t => <Tag color={actionToColor(t.event)}>
{domainEventTranslated[t.event as keyof typeof domainEventTranslated]}
</Tag>
)
}]}
{...(sm ? {scroll: {y: 'max-content'}} : {scroll: {y: 240}})}
/>