{"size": 692, "ext": "js", "max_stars_repo_path": "src/scripts/components/MenuContainer.js", "max_stars_repo_name": "nurmuhamadas/cafein-app", "max_stars_repo_stars_event_min_datetime": "2021-01-01T07:10:48.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-01T07:10:48.000Z", "max_issues_repo_path": "src/scripts/components/MenuContainer.js", "max_issues_repo_name": "nurmuhamadas/cafein-app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/scripts/components/MenuContainer.js", "max_forks_repo_name": "nurmuhamadas/cafein-app", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.3225806452, "max_line_length": 61, "alphanum_fraction": 0.6719653179}
import './MenuCardComponent';
import '../../styles/sass/MenuContainer.scss';

class MenuContainer extends HTMLElement {
  _insertMenu(menus) {
    const wrapper = this.querySelector('#restaurant__menus');
    const menuElement = document.createElement('menu-card');
    menuElement.menus = menus;
    wrapper.appendChild(menuElement);
  }

  set data(menus) {
    this._menus = menus;
  }

  connectedCallback() {
    this.render();

    this._insertMenu({ foods: this._menus.foods });
    this._insertMenu({ drinks: this._menus.drinks });
  }

  render() {
    this.innerHTML = `
      <div id="restaurant__menus"></div>
    `;
  }
}

customElements.define('menu-container', MenuContainer);
