export class TextField extends HTMLElement {
  static get observedAttributes() {
    return ["text"];
  }

  constructor() {
    super();
  }

  get text(): string | null {
    return this.getAttribute("text");
  }

  set text(text: string | null) {
    if (text) {
      this.setAttribute("text", text);
      this.innerHTML = text;
    } else {
      this.removeAttribute("text");
      this.innerHTML = "";
    }
  }
}
