/**
 * Watchlist UI (Legacy - Modernized to HTMX)
 */

async function displayWatchlist() {
    console.log('Legacy displayWatchlist called - redirected to HTMX');
    if (typeof htmx !== 'undefined') {
        htmx.trigger('#watchlist-items-container', 'load');
    }
}

// Global exposure for legacy calls
window.displayWatchlist = displayWatchlist;
window.handleDeleteFromWatchlist = (id) => {
    if (confirm('Retirer de la watchlist ?')) {
        htmx.ajax('DELETE', `/api/watchlist/${id}`, { target: `#watchlist-${id}`, swap: 'outerHTML' });
    }
};
