webrtc/public/weigets.js

22 lines
592 B
JavaScript
Raw Normal View History

2023-09-28 15:20:02 +08:00
export function Button({ innerText, onclick }) {
const button = document.createElement('button')
button.innerText = innerText
button.onclick = onclick
return button
}
export function List({ children = [] }) {
const ul = document.createElement('ul')
children.forEach(child => ul.appendChild(child))
return ul
}
export function ListItem({ innerText, onclick, id, children = [] }) {
const li = document.createElement('li')
li.innerText = innerText
li.onclick = onclick
li.id = id
children.forEach(child => li.appendChild(child))
return li
}