import {Popconfirm, theme, Typography} from 'antd' import {t} from 'ttag' import type { Watchlist} from '../../../utils/api' import {patchWatchlist} from '../../../utils/api' import {PauseCircleOutlined, PlayCircleOutlined} from '@ant-design/icons' import React from 'react' export function DisableWatchlistButton({watchlist, onChange, enabled}: { watchlist: Watchlist, onChange: () => void, enabled: boolean }) { const {token} = theme.useToken() return ( enabled ? await patchWatchlist(watchlist.token, {enabled: !enabled}).then(onChange)} okText={t`Yes`} cancelText={t`No`} okButtonProps={{danger: true}} > : await patchWatchlist(watchlist.token, {enabled: !enabled}).then(onChange)}/> ) }