mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
26 lines
963 B
TypeScript
26 lines
963 B
TypeScript
import React from 'react'
|
|
import type {Connector} from '../../../utils/api/connectors'
|
|
import {WatchlistCard} from './WatchlistCard'
|
|
import type {Watchlist} from '../../../utils/api'
|
|
|
|
export function WatchlistsList({watchlists, onChange, onUpdateWatchlist, connectors}: {
|
|
watchlists: Watchlist[]
|
|
onChange: () => void
|
|
onUpdateWatchlist: (values: { domains: string[], trackedEvents: string[], trackedEppStatus: string[], token: string }) => Promise<void>
|
|
connectors: Array<Connector & { id: string }>
|
|
}) {
|
|
return (
|
|
<>
|
|
{[...watchlists.filter(w => w.enabled), ...watchlists.filter(w => !w.enabled)].map(watchlist =>
|
|
<WatchlistCard
|
|
key={watchlist.token}
|
|
watchlist={watchlist}
|
|
onUpdateWatchlist={onUpdateWatchlist}
|
|
connectors={connectors}
|
|
onChange={onChange}
|
|
/>
|
|
)}
|
|
</>
|
|
)
|
|
}
|