2024-08-15 22:58:15 +02:00
|
|
|
import React from "react";
|
2024-08-16 13:56:52 +02:00
|
|
|
import {Watchlist} from "../../../pages/tracking/WatchlistPage";
|
|
|
|
|
import {Connector} from "../../../utils/api/connectors";
|
2024-08-18 17:28:45 +02:00
|
|
|
import {WatchlistCard} from "./WatchlistCard";
|
2024-07-31 02:55:20 +02:00
|
|
|
|
2024-08-15 03:04:31 +02:00
|
|
|
export function WatchlistsList({watchlists, onDelete, onUpdateWatchlist, connectors}: {
|
|
|
|
|
watchlists: Watchlist[],
|
|
|
|
|
onDelete: () => void,
|
2024-08-16 23:57:52 +02:00
|
|
|
onUpdateWatchlist: (values: { domains: string[], triggers: string[], token: string }) => Promise<void>,
|
2024-08-15 03:04:31 +02:00
|
|
|
connectors: (Connector & { id: string })[]
|
|
|
|
|
}) {
|
2024-07-31 02:55:20 +02:00
|
|
|
|
2024-08-15 03:04:31 +02:00
|
|
|
|
2024-07-29 18:54:28 +02:00
|
|
|
return <>
|
|
|
|
|
{watchlists.map(watchlist =>
|
2024-08-18 17:28:45 +02:00
|
|
|
<WatchlistCard watchlist={watchlist}
|
|
|
|
|
onUpdateWatchlist={onUpdateWatchlist}
|
|
|
|
|
connectors={connectors}
|
|
|
|
|
onDelete={onDelete}/>
|
|
|
|
|
)
|
|
|
|
|
}
|
2024-07-29 18:54:28 +02:00
|
|
|
</>
|
|
|
|
|
}
|