import { getCurrentTabInfo, enableItem, generateArray } from './utils';
import * as instance from './instances';
const items = generateArray(instance);
export function renderItems() {
const containerItems = document.getElementById('root');
containerItems.innerHTML = '';
items.forEach((value) => {
const name = value.name;
const html = `
${name}
`;
containerItems.insertAdjacentHTML('afterbegin', html);
getCurrentTabInfo();
});
items.map((value) => enableItem(value));
// Options button
const htmlOptions = `
Options
`;
containerItems.insertAdjacentHTML('beforeend', htmlOptions);
// Open options page
const optionsBtn = document.getElementById('options');
function openOptions() {
browser.runtime.openOptionsPage();
}
optionsBtn.addEventListener('click', openOptions);
}