import type { PermissionType } from '@/enums';
import { usePermissionStore } from '@/stores';

export const usePermission = () => {
  const permissionStore = usePermissionStore();

  const hasPermission = (stationCode: string, permissionType: PermissionType) => {
    return !!permissionStore.permissions[stationCode]?.includes(permissionType);
  };

  return {
    hasPermission,
  };
};
