import { Component, OnInit } from "@angular/core";

declare interface RouteInfo {
  path: string;
  title: string;
  rtlTitle: string;
  icon: string;
  class: string;
}
export const ROUTES: RouteInfo[] = [
  {
    path: "/home-page",
    title: "หน้าหลัก",
    rtlTitle: "",
    icon: "icon-shape-star",
    class: ""
  },
  {
    path: "/equipment",
    title: "รายการอุปกรณ์",
    rtlTitle: "",
    icon: "icon-cart",
    class: ""
  },
  {
    path: "/admin-equirment",
    title: "รายการอุปกรณ์ Admin",
    rtlTitle: "",
    icon: "icon-bag-16",
    class: ""
  },
  {
    path: "/pending",
    title: "รายการทั้งหมด",
    rtlTitle: "",
    icon: "icon-notes",
    class: ""
  },
  {
    path: "/admin-pending",
    title: "รายการรออนุมัติ",
    rtlTitle: "",
    icon: "icon-bag-16",
    class: ""
  },

  {
    path: "/contact-admin",
    title: "ติดต่อแอดมิน",
    rtlTitle: "",
    icon: "icon-bag-16",
    class: ""
  },
];

@Component({
  selector: "app-sidebar",
  templateUrl: "./sidebar.component.html",
  styleUrls: ["./sidebar.component.css"]
})
export class SidebarComponent implements OnInit {
  menuItems: any[];

  constructor() {}

  ngOnInit() {
    this.menuItems = ROUTES.filter(menuItem => menuItem);
  }
  isMobileMenu() {
    if (window.innerWidth > 991) {
      return false;
    }
    return true;
  }
}
