mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: translate domain events in watchlistsList
This commit is contained in:
@@ -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}})}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user