Spaces:
Running
Running
File size: 1,564 Bytes
80d8c84 | 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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function formatScore(value: number): string {
return (value * 100).toFixed(0) + '%';
}
export function formatReward(value: number): string {
return value.toFixed(2);
}
export function roleColor(role: string): string {
switch (role) {
case 'scientist':
return 'text-scientist';
case 'lab_manager':
return 'text-lab-manager';
case 'judge':
return 'text-judge';
default:
return 'text-foreground';
}
}
export function roleBgColor(role: string): string {
switch (role) {
case 'scientist':
return 'bg-scientist/10 border-scientist/30';
case 'lab_manager':
return 'bg-lab-manager/10 border-lab-manager/30';
case 'judge':
return 'bg-judge/10 border-judge/30';
default:
return 'bg-muted border-border';
}
}
export function roleLabel(role: string): string {
switch (role) {
case 'scientist':
return 'Dr. Elara';
case 'lab_manager':
return 'Takuma';
case 'judge':
return 'Judge Aldric';
default:
return role;
}
}
export function verdictColor(verdict: string): string {
switch (verdict) {
case 'success':
case 'accept':
return 'text-lab-manager';
case 'partial':
case 'revise':
return 'text-judge';
case 'failure':
case 'reject':
return 'text-destructive';
default:
return 'text-muted-foreground';
}
}
|