import { Utils } from "./Utils";

export class UtilCard {
  parent: HTMLElement;
  card: HTMLElement;
  cardBody: HTMLElement;
  cardHeder: HTMLElement;
  cardFooter: HTMLElement;
  item: any;
  constructor(parent: HTMLElement) {
    this.parent = parent;
    this.card = Utils.card();
    this.cardBody = Utils.cardBody();
    this.cardHeder = Utils.cardHeader();
    this.cardFooter = Utils.cardFooter();
    this.configure();
  }
  configure() {
    this.card.appendChild(this.cardHeder);
    this.card.appendChild(this.cardBody);
    this.card.appendChild(this.cardFooter);
    this.parent.appendChild(this.card);
  }
  setHeader(content: HTMLElement) {
    this.cardHeder.innerHTML = "";
    this.cardHeder.appendChild(content);
  }
  setBody(content: HTMLElement) {
    this.cardBody.innerHTML = "";
    this.cardBody.appendChild(content);
  }
  setFooter(content: HTMLElement) {
    this.cardFooter.innerHTML = "";
    this.cardFooter.appendChild(content);
  }
}
