@@ -13,6 +13,38 @@ import {
1313} from 'lucide-react'
1414import { tv } from 'tailwind-variants'
1515
16+ // Map types to their icons - source of truth for badge types
17+ export const typeIcons = {
18+ blank : Code ,
19+ code : Code ,
20+ hideTrashed : EyeOff ,
21+ image : Image ,
22+ link : Link ,
23+ open : Monitor ,
24+ sent : MailCheck ,
25+ settings : Settings ,
26+ text : TextSelect ,
27+ time : Clock ,
28+ trashed : Trash2 ,
29+ unsent : MessageSquareDashed ,
30+ } as const
31+
32+ // Type colors definition - must be exhaustive with typeIcons
33+ export const typeColors = {
34+ blank : 'bg-transparent text-gray-700' ,
35+ code : 'bg-pink-50 text-pink-700' ,
36+ hideTrashed : 'bg-transparent text-gray-700' ,
37+ image : 'bg-purple-50 text-purple-700' ,
38+ link : 'bg-blue-50 text-blue-700' ,
39+ open : 'bg-cyan-50 text-cyan-700' ,
40+ sent : 'bg-green-50 text-green-700' ,
41+ settings : 'bg-gray-50 text-gray-700' ,
42+ text : 'bg-gray-50 text-gray-700' ,
43+ time : 'bg-gray-50 text-gray-700' ,
44+ trashed : 'bg-gray-50 text-yellow-700' ,
45+ unsent : 'bg-amber-100 text-amber-700' ,
46+ } as const satisfies Record < keyof typeof typeIcons , string >
47+
1648// TV configuration for stat badges
1749export const badgeCVA = tv ( {
1850 base : 'inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-normal h-5' ,
@@ -28,35 +60,6 @@ export const badgeCVA = tv({
2860 false : '' ,
2961 true : '!border-solid !border-current' ,
3062 } ,
31- type : {
32- blank : 'bg-transparent text-gray-700' ,
33- code : 'bg-pink-50 text-pink-700' ,
34- hideTrashed : 'bg-transparent text-gray-700' ,
35- image : 'bg-purple-50 text-purple-700' ,
36- link : 'bg-blue-50 text-blue-700' ,
37- open : 'bg-cyan-50 text-cyan-700' ,
38- sent : 'bg-green-50 text-green-700' ,
39- settings : 'bg-gray-50 text-gray-700' ,
40- text : 'bg-gray-50 text-gray-700' ,
41- time : 'bg-gray-50 text-gray-700' ,
42- trashed : 'bg-gray-50 text-yellow-700' ,
43- unsent : 'bg-amber-100 text-amber-700' ,
44- } ,
63+ type : typeColors ,
4564 } ,
4665} )
47-
48- // Map types to their icons
49- export const typeIcons = {
50- blank : Code ,
51- code : Code ,
52- hideTrashed : EyeOff ,
53- image : Image ,
54- link : Link ,
55- open : Monitor ,
56- sent : MailCheck ,
57- settings : Settings ,
58- text : TextSelect ,
59- time : Clock ,
60- trashed : Trash2 ,
61- unsent : MessageSquareDashed ,
62- } as const
0 commit comments