import { useUserStore } from '../../store/modules/user'
import { toRaw } from 'vue'

const userStore = useUserStore()

export const useBtnAuth = (path: string) => {
  let btn
  toRaw(userStore.getBtnAuth)?.forEach((item) => {
    if (path?.split('?')[0].split('/')?.includes(item.path) && item.btns.length) {
      btn = item.btns
    }
  })
  return btn || []
}
