import { useDictStore } from '@/stores/dict'

export const getDict = async (type: string) => {
  const dictStore = useDictStore()
  const dict = await dictStore.getDict(type)
  return dict
}

export const filterDict = (value: string, options: Array<any>) => {
  const dict = options && options.filter(item => item.value === value)
  return dict && dict[0]?.label
}
