// import { useGlobalInfo } from '#/store'

// let userPermissions: any = null
nextTick(() => {
  // const userinfo = toRefs(useGlobalInfo())
  // userPermissions = userinfo.userPermissions
})

export default function auth(
  el: HTMLElement,
  { value }: { value: string | string[] | undefined },
) {
  // if (value === undefined) {
  //   return
  // }
  // if (typeof value === 'object') {
  //   if (value.every((val) => !userPermissions.value.includes(val))) el?.remove()
  //   return
  // }
  // if (!userPermissions.value.includes(value)) {
  //   if (el.className.includes('switch-box')) {
  //     el.classList.value += ' disabled'
  //     const elSwitch: HTMLElement = el.querySelector('.switch') as HTMLElement
  //     // eslint-disable-next-line unicorn/prefer-add-event-listener
  //     elSwitch.onclick = (e) => e.stopPropagation()
  //     const spans: NodeListOf<HTMLSpanElement> = el.querySelectorAll('span')
  //     spans.forEach((i) => {
  //       // eslint-disable-next-line unicorn/prefer-add-event-listener
  //       i.onclick = (e) => e.stopPropagation()
  //     })
  //     return
  //   }
  //   el?.remove()
  // }
}
