status.ts
1.45 KB
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
import {
CheckCircle2,
Clock,
Loader2,
XCircle,
Ban,
Code2,
Layers,
FileBarChart2,
type LucideIcon,
} from 'lucide-react';
import type { JobStatus, ValidationMode } from './types';
export type Tone =
| 'brand'
| 'neutral'
| 'success'
| 'warning'
| 'danger'
| 'info';
export const statusMeta: Record<
JobStatus,
{ label: string; tone: Tone; icon: LucideIcon; spin?: boolean }
> = {
queued: { label: '排队中', tone: 'neutral', icon: Clock },
running: { label: '生成中', tone: 'info', icon: Loader2, spin: true },
done: { label: '已完成', tone: 'success', icon: CheckCircle2 },
cancelled: { label: '已取消', tone: 'neutral', icon: Ban },
error: { label: '失败', tone: 'danger', icon: XCircle },
};
export const modeMeta: Record<
ValidationMode,
{ label: string; short: string; desc: string; icon: LucideIcon; tone: Tone }
> = {
code: {
label: '仅代码',
short: 'Code',
desc: 'Figma → React 代码,最快交付',
icon: Code2,
tone: 'brand',
},
full: {
label: '完整流程',
short: 'Full',
desc: '代码 + 自动化校验与自修复',
icon: Layers,
tone: 'info',
},
'with-report': {
label: '带报告',
short: 'Report',
desc: '完整流程并产出可视化报告',
icon: FileBarChart2,
tone: 'warning',
},
};
export const modeLabel: Record<ValidationMode, string> = {
full: '完整流程',
code: '仅代码',
'with-report': '带报告',
};