26 lines
863 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
2024-08-15 03:04:31 +02:00
export function WatchlistsList({watchlists, onDelete, onUpdateWatchlist, connectors}: {
2024-12-30 23:50:15 +01:00
watchlists: Watchlist[]
onDelete: () => void
onUpdateWatchlist: (values: { domains: string[], triggers: string[], token: string }) => Promise<void>
connectors: Array<Connector & { id: string }>
2024-08-15 03:04:31 +02:00
}) {
2024-12-30 23:50:15 +01:00
return (
<>
{watchlists.map(watchlist =>
<WatchlistCard
key={watchlist.token}
watchlist={watchlist}
onUpdateWatchlist={onUpdateWatchlist}
connectors={connectors}
onDelete={onDelete}
/>
)}
</>
)
}