2024-12-30 23:50:15 +01:00
|
|
|
import React from 'react'
|
2024-12-31 13:55:42 +01:00
|
|
|
import type {Connector} from '../../../utils/api/connectors'
|
2024-12-30 23:50:15 +01:00
|
|
|
import {WatchlistCard} from './WatchlistCard'
|
2024-12-31 13:55:42 +01:00
|
|
|
import type {Watchlist} from '../../../utils/api'
|
2024-07-31 02:55:20 +02:00
|
|
|
|
2025-10-25 19:23:15 +02:00
|
|
|
export function WatchlistsList({watchlists, onChange, onUpdateWatchlist, connectors}: {
|
2024-12-30 23:50:15 +01:00
|
|
|
watchlists: Watchlist[]
|
2025-10-25 19:23:15 +02:00
|
|
|
onChange: () => void
|
2025-10-19 21:37:52 +02:00
|
|
|
onUpdateWatchlist: (values: { domains: string[], trackedEvents: string[], trackedEppStatus: string[], token: string }) => Promise<void>
|
2024-12-30 23:50:15 +01:00
|
|
|
connectors: Array<Connector & { id: string }>
|
2024-08-15 03:04:31 +02:00
|
|
|
}) {
|
2024-12-30 23:50:15 +01:00
|
|
|
return (
|
|
|
|
|
<>
|
2025-10-25 19:23:15 +02:00
|
|
|
{[...watchlists.filter(w => w.enabled), ...watchlists.filter(w => !w.enabled)].map(watchlist =>
|
2024-12-30 23:50:15 +01:00
|
|
|
<WatchlistCard
|
|
|
|
|
key={watchlist.token}
|
|
|
|
|
watchlist={watchlist}
|
|
|
|
|
onUpdateWatchlist={onUpdateWatchlist}
|
|
|
|
|
connectors={connectors}
|
2025-10-25 19:23:15 +02:00
|
|
|
onChange={onChange}
|
2024-12-30 23:50:15 +01:00
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|