export function splitStringByUnderscore(str: string) {
  return str.split("_").join(" ");
}

// Enhanced fetch with logging
export async function fetchWithFallback<T>(
  promise: Promise<T>,
  fallback: T
): Promise<T> {
  try {
    const result = await promise;
    return result;
  } catch (error) {
    // Add your error reporting here (Sentry, App Insights, etc.)
    return fallback;
  }
}
