|
6 | 6 | WorkshopRegistrationSettings, |
7 | 7 | AdminPageHeader, |
8 | 8 | } from '@/components/admin' |
| 9 | +import { StatusBadge } from '@/components/StatusBadge' |
9 | 10 | import { |
10 | 11 | CalendarIcon, |
11 | 12 | GlobeAltIcon, |
@@ -33,31 +34,6 @@ function isValidFormat(key: string): key is Format { |
33 | 34 | return Object.values(Format).includes(key as Format) |
34 | 35 | } |
35 | 36 |
|
36 | | -function Badge({ |
37 | | - children, |
38 | | - variant = 'default', |
39 | | -}: { |
40 | | - children: React.ReactNode |
41 | | - variant?: 'default' | 'success' | 'warning' | 'error' |
42 | | -}) { |
43 | | - const variants = { |
44 | | - default: 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300', |
45 | | - success: |
46 | | - 'bg-green-100 text-green-800 dark:bg-green-900/20 dark:text-green-400', |
47 | | - warning: |
48 | | - 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/20 dark:text-yellow-400', |
49 | | - error: 'bg-red-100 text-red-800 dark:bg-red-900/20 dark:text-red-400', |
50 | | - } |
51 | | - |
52 | | - return ( |
53 | | - <span |
54 | | - className={`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${variants[variant]}`} |
55 | | - > |
56 | | - {children} |
57 | | - </span> |
58 | | - ) |
59 | | -} |
60 | | - |
61 | 37 | function InfoCard({ |
62 | 38 | title, |
63 | 39 | children, |
@@ -147,7 +123,7 @@ function FieldRow({ |
147 | 123 | : (item as NamedItem)?.title || |
148 | 124 | (item as NamedItem)?.name || |
149 | 125 | JSON.stringify(item) |
150 | | - return <Badge key={idx}>{displayText}</Badge> |
| 126 | + return <StatusBadge key={idx} label={displayText} color="gray" /> |
151 | 127 | })} |
152 | 128 | </div> |
153 | 129 | ) : ( |
@@ -189,7 +165,7 @@ function FieldRow({ |
189 | 165 | formatKey && isValidFormat(formatKey) |
190 | 166 | ? formats.get(formatKey) || formatKey |
191 | 167 | : formatKey || 'Unknown Format' |
192 | | - return <Badge key={idx}>{displayText}</Badge> |
| 168 | + return <StatusBadge key={idx} label={displayText} color="gray" /> |
193 | 169 | })} |
194 | 170 | </div> |
195 | 171 | ) : ( |
@@ -422,9 +398,11 @@ export default async function AdminSettings() { |
422 | 398 | {tier.title} |
423 | 399 | </span> |
424 | 400 | <div className="flex items-center space-x-2"> |
425 | | - {tier.soldOut && <Badge variant="error">Sold Out</Badge>} |
| 401 | + {tier.soldOut && ( |
| 402 | + <StatusBadge label="Sold Out" color="red" /> |
| 403 | + )} |
426 | 404 | {tier.mostPopular && ( |
427 | | - <Badge variant="success">Popular</Badge> |
| 405 | + <StatusBadge label="Popular" color="green" /> |
428 | 406 | )} |
429 | 407 | </div> |
430 | 408 | </div> |
|
0 commit comments