26 lines
963 B
TypeScript
Raw Normal View History

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
export function WatchlistsList({watchlists, onChange, onUpdateWatchlist, connectors}: {
2024-12-30 23:50:15 +01:00
watchlists: Watchlist[]
onChange: () => void
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 (
<>
{[...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}
onChange={onChange}
2024-12-30 23:50:15 +01:00
/>
)}
</>
)
}