MCPcopy Create free account
hub / github.com/echoVic/blade-code / status

Method status

src/ui/utils/formatter.ts:103–123  ·  view source on GitHub ↗

* 格式化状态

(
    status: 'success' | 'error' | 'warning' | 'info' | 'pending',
    text?: string
  )

Source from the content-addressed store, hash-verified

101 * 格式化状态
102 */
103 public static status(
104 status: 'success' | 'error' | 'warning' | 'info' | 'pending',
105 text?: string
106 ): string {
107 const statusText = text || status;
108
109 switch (status) {
110 case 'success':
111 return UIStyles.status.success(`✓ ${statusText}`);
112 case 'error':
113 return UIStyles.status.error(`✗ ${statusText}`);
114 case 'warning':
115 return UIStyles.status.warning(`⚠ ${statusText}`);
116 case 'info':
117 return UIStyles.status.info(`ℹ ${statusText}`);
118 case 'pending':
119 return UIStyles.status.muted(`◯ ${statusText}`);
120 default:
121 return statusText;
122 }
123 }
124
125 /**
126 * 格式化列表项

Callers

nothing calls this directly

Calls 5

successMethod · 0.80
warningMethod · 0.80
mutedMethod · 0.80
errorMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected