UNPKG

asciitorium

Version:
20 lines (19 loc) 619 B
import { Component } from '../core/Component.js'; import { State } from '../core/State.js'; export class Option extends Component { constructor(props) { const { children: childrenString, ...componentProps } = props; super({ ...componentProps, width: 0, height: 0, visible: new State(false), // Data-only component, not visual }); this.value = props.value; this.label = childrenString || String(props.value); } draw() { // Option is not rendered directly, it's just a data container return [[]]; } }