phase-10.5: market screener ui enhancements
This commit is contained in:
@@ -9,25 +9,49 @@
|
||||
*/
|
||||
export function verdictShort(label: string | null | undefined): string {
|
||||
if (!label) return '—';
|
||||
if (label.includes('High Conviction')) return 'Strong';
|
||||
if (label.includes('High Conviction')) return 'Strong Buy';
|
||||
if (label.includes('Speculative')) return 'Speculative';
|
||||
if (label.includes('Momentum')) return 'Momentum';
|
||||
if (label.includes('BUY')) return 'Buy';
|
||||
if (label.includes('Efficient')) return 'Efficient';
|
||||
if (label.includes('Attractive')) return 'Attractive';
|
||||
if (label.includes('Neutral')) return 'Hold';
|
||||
if (label.includes('REJECT')) return 'Reject';
|
||||
if (label.includes('Avoid')) return 'Avoid';
|
||||
return label.replace(/[🟢🟡🔴]/u, '').trim();
|
||||
return label.replace(/[\u{1F7E2}\u{1F7E1}\u{1F534}]/u, '').trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a CSS colour class ('green' | 'yellow' | 'red') based on
|
||||
* the emoji prefix of a verdict label.
|
||||
* Returns a CSS colour class based on the verdict label content.
|
||||
*
|
||||
* Signal mapping:
|
||||
* 🟢 / High Conviction / Efficient / Attractive → green
|
||||
* 🟡 / Speculative / Momentum → yellow
|
||||
* Neutral / Hold / no signal → blue (calm, not alarming)
|
||||
* 🔴 / Avoid / Reject / REJECT → red
|
||||
*/
|
||||
export function vClass(label: string | null | undefined): 'green' | 'yellow' | 'red' {
|
||||
if (label?.startsWith('🟢')) return 'green';
|
||||
if (label?.startsWith('🟡')) return 'yellow';
|
||||
return 'red';
|
||||
export function vClass(
|
||||
label: string | null | undefined,
|
||||
): 'green' | 'yellow' | 'red' | 'blue' | 'gray' {
|
||||
if (!label) return 'gray';
|
||||
if (
|
||||
label.startsWith('🟢') ||
|
||||
label.includes('High Conviction') ||
|
||||
label.includes('Efficient') ||
|
||||
label.includes('Attractive')
|
||||
)
|
||||
return 'green';
|
||||
if (label.startsWith('🟡') || label.includes('Speculative') || label.includes('Momentum'))
|
||||
return 'yellow';
|
||||
if (
|
||||
label.startsWith('🔴') ||
|
||||
label.includes('Avoid') ||
|
||||
label.includes('Reject') ||
|
||||
label.includes('REJECT')
|
||||
)
|
||||
return 'red';
|
||||
if (label.includes('Neutral') || label.includes('Hold') || label.includes('BUY')) return 'blue';
|
||||
return 'gray';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user