summaryrefslogtreecommitdiff
path: root/lib/avl/components/project-field-utils.ts
blob: d3d842956195f89309568c2925b58e9bf566c29f (plain)
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
42
43
44
45
// 프로젝트 검색 상태 타입
export type ProjectSearchStatus = 'idle' | 'searching' | 'success-projects' | 'success-bidding' | 'error'

// 프로젝트 상태에 따른 스타일링 유틸리티 함수들
export const getLabelStatusClassName = (status: ProjectSearchStatus): string => {
  switch (status) {
    case 'error':
      return 'text-red-600'
    case 'success-projects':
    case 'success-bidding':
      return 'text-green-600'
    case 'searching':
      return 'text-blue-600'
    default:
      return 'text-muted-foreground'
  }
}

export const getDisplayElementStatusClassName = (status: ProjectSearchStatus): string => {
  switch (status) {
    case 'error':
      return 'border-red-300'
    case 'success-projects':
    case 'success-bidding':
      return 'border-green-300'
    case 'searching':
      return 'border-blue-300'
    default:
      return 'border-input'
  }
}

export const getInputStatusClassName = (status: ProjectSearchStatus): string => {
  switch (status) {
    case 'error':
      return 'border-red-300 focus:border-red-500 focus:ring-red-500/20'
    case 'success-projects':
    case 'success-bidding':
      return 'border-green-300 focus:border-green-500 focus:ring-green-500/20'
    case 'searching':
      return 'border-blue-300 focus:border-blue-500 focus:ring-blue-500/20'
    default:
      return ''
  }
}