File size: 816 Bytes
8b7b267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
 * Loading Helper Functions
 * Simple wrapper around Loading class for easy usage
 */

import Loading from './loading.js';

/**
 * Show loading state
 */
export function showLoading(containerId, message = 'Loading...') {
  return Loading.show(containerId, message);
}

/**
 * Hide loading state
 */
export function hideLoading(containerId) {
  return Loading.hide(containerId);
}

/**
 * Show skeleton loader
 */
export function showSkeleton(containerId, type = 'cards', count = 4) {
  const container = document.getElementById(containerId);
  if (!container) return;
  
  if (type === 'cards') {
    container.innerHTML = Loading.skeletonCards(count);
  } else if (type === 'rows') {
    container.innerHTML = Loading.skeletonRows(count);
  }
}

export default {
  showLoading,
  hideLoading,
  showSkeleton
};