File size: 753 Bytes
e06118d
 
 
 
7ced29c
e06118d
7ced29c
 
 
 
e06118d
 
 
7ced29c
 
e06118d
7ced29c
 
e06118d
7ced29c
 
 
e06118d
7ced29c
e06118d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// scripts/ui.js

const getElement = (id) => document.getElementById(id);

function loadRecommendations() {
    const container = getElement('recommendations-container');
    // The error happened here. Now the container should be found.
    if (container) {
        container.innerHTML = '<p>Recommendations will appear here soon...</p>';
    }
}

export function initUI() {
    const productionButton = getElement('production-button');
    const productionPanel = getElement('production-panel');

    // This will run our function on page load
    loadRecommendations();

    if (productionButton && productionPanel) {
        productionButton.addEventListener('click', () => {
            productionPanel.classList.toggle('open');
        });
    }
}