|
1
|
"use client" |
|
2
|
|
|
3
|
import React, { useMemo } from "react" |
|
4
|
import { IconProps } from "@medusajs/icons/dist/types" |
|
5
|
import { BadgeVariant } from "../../.." |
|
6
|
|
|
7
|
type ShadedBgIconProps = IconProps & { |
|
8
|
variant?: BadgeVariant |
|
9
|
} |
|
10
|
|
|
11
|
export const ShadedBgIcon = ({ |
|
12
|
variant = "blue", |
|
13
|
...props |
|
14
|
}: ShadedBgIconProps) => { |
|
15
|
const color = useMemo(() => { |
|
16
|
switch (variant) { |
|
17
|
case "neutral": |
|
18
|
case "code": |
|
19
|
return "var(--docs-tags-neutral-border)" |
|
20
|
case "blue": |
|
21
|
return "var(--docs-tags-blue-border)" |
|
22
|
case "purple": |
|
23
|
return "var(--docs-tags-purple-border)" |
|
24
|
case "green": |
|
25
|
return "var(--docs-tags-green-border)" |
|
26
|
case "orange": |
|
27
|
return "var(--docs-tags-orange-border)" |
|
28
|
case "red": |
|
29
|
return "var(--docs-tags-red-border)" |
|
30
|
} |
|
31
|
}, [variant]) |
|
32
|
|
|
33
|
return ( |
|
34
|
<svg |
|
35
|
fill="none" |
|
36
|
xmlns="http://www.w3.org/2000/svg" |
|
37
|
height="100%" |
|
38
|
width="100%" |
|
39
|
{...props} |
|
40
|
> |
|
41
|
<g clipPath="url(#clip0_10402_37468)"> |
|
42
|
<rect |
|
43
|
x="32.3379" |
|
44
|
y="-66.5442" |
|
45
|
width="1.5" |
|
46
|
height="96" |
|
47
|
transform="rotate(45 32.3379 -66.5442)" |
|
48
|
fill={color} |
|
49
|
/> |
|
50
|
<rect |
|
51
|
x="34.813" |
|
52
|
y="-64.0694" |
|
53
|
width="1.5" |
|
54
|
height="96" |
|
55
|
transform="rotate(45 34.813 -64.0694)" |
|
56
|
fill={color} |
|
57
|
/> |
|
58
|
<rect |
|
59
|
x="37.2876" |
|
60
|
y="-61.5945" |
|
61
|
width="1.5" |
|
62
|
height="96" |
|
63
|
transform="rotate(45 37.2876 -61.5945)" |
|
64
|
fill={color} |
|
65
|
/> |
|
66
|
<rect |
|
67
|
x="39.7627" |
|
68
|
y="-59.1196" |
|
69
|
width="1.5" |
|
70
|
height="96" |
|
71
|
transform="rotate(45 39.7627 -59.1196)" |
|
72
|
fill={color} |
|
73
|
/> |
|
74
|
<rect |
|
75
|
x="42.2373" |
|
76
|
y="-56.6447" |
|
77
|
width="1.5" |
|
78
|
height="96" |
|
79
|
transform="rotate(45 42.2373 -56.6447)" |
|
80
|
fill={color} |
|
81
|
/> |
|
82
|
<rect |
|
83
|
x="44.7124" |
|
84
|
y="-54.1699" |
|
85
|
width="1.5" |
|
86
|
height="96" |
|
87
|
transform="rotate(45 44.7124 -54.1699)" |
|
88
|
fill={color} |
|
89
|
/> |
|
90
|
<rect |
|
91
|
x="47.187" |
|
92
|
y="-51.695" |
|
93
|
width="1.5" |
|
94
|
height="96" |
|
95
|
transform="rotate(45 47.187 -51.695)" |
|
96
|
fill={color} |
|
97
|
/> |
|
98
|
<rect |
|
99
|
x="49.6621" |
|
100
|
y="-49.2201" |
|
101
|
width="1.5" |
|
102
|
height="96" |
|
103
|
transform="rotate(45 49.6621 -49.2201)" |
|
104
|
fill={color} |
|
105
|
/> |
|
106
|
<rect |
|
107
|
x="52.1367" |
|
108
|
y="-46.7452" |
|
109
|
width="1.5" |
|
110
|
height="96" |
|
111
|
transform="rotate(45 52.1367 -46.7452)" |
|
112
|
fill={color} |
|
113
|
/> |
|
114
|
<rect |
|
115
|
x="54.6118" |
|
116
|
y="-44.2704" |
|
117
|
width="1.5" |
|
118
|
height="96" |
|
119
|
transform="rotate(45 54.6118 -44.2704)" |
|
120
|
fill={color} |
|
121
|
/> |
|
122
|
<rect |
|
123
|
x="57.0869" |
|
124
|
y="-41.7955" |
|
125
|
width="1.5" |
|
126
|
height="96" |
|
127
|
transform="rotate(45 57.0869 -41.7955)" |
|
128
|
fill={color} |
|
129
|
/> |
|
130
|
<rect |
|
131
|
x="59.5615" |
|
132
|
y="-39.3206" |
|
133
|
width="1.5" |
|
134
|
height="96" |
|
135
|
transform="rotate(45 59.5615 -39.3206)" |
|
136
|
fill={color} |
|
137
|
/> |
|
138
|
<rect |
|
139
|
x="62.0366" |
|
140
|
y="-36.8458" |
|
141
|
width="1.5" |
|
142
|
height="96" |
|
143
|
transform="rotate(45 62.0366 -36.8458)" |
|
144
|
fill={color} |
|
145
|
/> |
|
146
|
<rect |
|
147
|
x="64.5112" |
|
148
|
y="-34.3709" |
|
149
|
width="1.5" |
|
150
|
height="96" |
|
151
|
transform="rotate(45 64.5112 -34.3709)" |
|
152
|
fill={color} |
|
153
|
/> |
|
154
|
<rect |
|
155
|
x="66.9863" |
|
156
|
y="-31.896" |
|
157
|
width="1.5" |
|
158
|
height="96" |
|
159
|
transform="rotate(45 66.9863 -31.896)" |
|
160
|
fill={color} |
|
161
|
/> |
|
162
|
<rect |
|
163
|
x="69.4609" |
|
164
|
y="-29.4211" |
|
165
|
width="1.5" |
|
166
|
height="96" |
|
167
|
transform="rotate(45 69.4609 -29.4211)" |
|
168
|
fill={color} |
|
169
|
/> |
|
170
|
<rect |
|
171
|
x="71.936" |
|
172
|
y="-26.9463" |
|
173
|
width="1.5" |
|
174
|
height="96" |
|
175
|
transform="rotate(45 71.936 -26.9463)" |
|
176
|
fill={color} |
|
177
|
/> |
|
178
|
<rect |
|
179
|
x="74.4106" |
|
180
|
y="-24.4714" |
|
181
|
width="1.5" |
|
182
|
height="96" |
|
183
|
transform="rotate(45 74.4106 -24.4714)" |
|
184
|
fill={color} |
|
185
|
/> |
|
186
|
<rect |
|
187
|
x="76.8857" |
|
188
|
y="-21.9965" |
|
189
|
width="1.5" |
|
190
|
height="96" |
|
191
|
transform="rotate(45 76.8857 -21.9965)" |
|
192
|
fill={color} |
|
193
|
/> |
|
194
|
<rect |
|
195
|
x="79.3604" |
|
196
|
y="-19.5216" |
|
197
|
width="1.5" |
|
198
|
height="96" |
|
199
|
transform="rotate(45 79.3604 -19.5216)" |
|
200
|
fill={color} |
|
201
|
/> |
|
202
|
<rect |
|
203
|
x="81.8354" |
|
204
|
y="-17.0468" |
|
205
|
width="1.5" |
|
206
|
height="96" |
|
207
|
transform="rotate(45 81.8354 -17.0468)" |
|
208
|
fill={color} |
|
209
|
/> |
|
210
|
<rect |
|
211
|
x="84.3105" |
|
212
|
y="-14.5719" |
|
213
|
width="1.5" |
|
214
|
height="96" |
|
215
|
transform="rotate(45 84.3105 -14.5719)" |
|
216
|
fill={color} |
|
217
|
/> |
|
218
|
<rect |
|
219
|
x="86.7852" |
|
220
|
y="-12.097" |
|
221
|
width="1.5" |
|
222
|
height="96" |
|
223
|
transform="rotate(45 86.7852 -12.097)" |
|
224
|
fill={color} |
|
225
|
/> |
|
226
|
<rect |
|
227
|
x="89.2603" |
|
228
|
y="-9.62215" |
|
229
|
width="1.5" |
|
230
|
height="96" |
|
231
|
transform="rotate(45 89.2603 -9.62215)" |
|
232
|
fill={color} |
|
233
|
/> |
|
234
|
<rect |
|
235
|
x="91.7349" |
|
236
|
y="-7.14726" |
|
237
|
width="1.5" |
|
238
|
height="96" |
|
239
|
transform="rotate(45 91.7349 -7.14726)" |
|
240
|
fill={color} |
|
241
|
/> |
|
242
|
<rect |
|
243
|
x="94.21" |
|
244
|
y="-4.67239" |
|
245
|
width="1.5" |
|
246
|
height="96" |
|
247
|
transform="rotate(45 94.21 -4.67239)" |
|
248
|
fill={color} |
|
249
|
/> |
|
250
|
<rect |
|
251
|
x="96.6846" |
|
252
|
y="-2.19753" |
|
253
|
width="1.5" |
|
254
|
height="96" |
|
255
|
transform="rotate(45 96.6846 -2.19753)" |
|
256
|
fill={color} |
|
257
|
/> |
|
258
|
<rect |
|
259
|
x="99.1597" |
|
260
|
y="0.277344" |
|
261
|
width="1.5" |
|
262
|
height="96" |
|
263
|
transform="rotate(45 99.1597 0.277344)" |
|
264
|
fill={color} |
|
265
|
/> |
|
266
|
<rect |
|
267
|
x="101.634" |
|
268
|
y="2.75223" |
|
269
|
width="1.5" |
|
270
|
height="96" |
|
271
|
transform="rotate(45 101.634 2.75223)" |
|
272
|
fill={color} |
|
273
|
/> |
|
274
|
<rect |
|
275
|
x="104.109" |
|
276
|
y="5.2271" |
|
277
|
width="1.5" |
|
278
|
height="96" |
|
279
|
transform="rotate(45 104.109 5.2271)" |
|
280
|
fill={color} |
|
281
|
/> |
|
282
|
<rect |
|
283
|
x="106.584" |
|
284
|
y="7.70197" |
|
285
|
width="1.5" |
|
286
|
height="96" |
|
287
|
transform="rotate(45 106.584 7.70197)" |
|
288
|
fill={color} |
|
289
|
/> |
|
290
|
<rect |
|
291
|
x="109.059" |
|
292
|
y="10.1768" |
|
293
|
width="1.5" |
|
294
|
height="96" |
|
295
|
transform="rotate(45 109.059 10.1768)" |
|
296
|
fill={color} |
|
297
|
/> |
|
298
|
<rect |
|
299
|
x="111.534" |
|
300
|
y="12.6517" |
|
301
|
width="1.5" |
|
302
|
height="96" |
|
303
|
transform="rotate(45 111.534 12.6517)" |
|
304
|
fill={color} |
|
305
|
/> |
|
306
|
<rect |
|
307
|
x="114.009" |
|
308
|
y="15.1266" |
|
309
|
width="1.5" |
|
310
|
height="96" |
|
311
|
transform="rotate(45 114.009 15.1266)" |
|
312
|
fill={color} |
|
313
|
/> |
|
314
|
<rect |
|
315
|
x="116.484" |
|
316
|
y="17.6015" |
|
317
|
width="1.5" |
|
318
|
height="96" |
|
319
|
transform="rotate(45 116.484 17.6015)" |
|
320
|
fill={color} |
|
321
|
/> |
|
322
|
</g> |
|
323
|
<defs> |
|
324
|
<clipPath id="clip0_10402_37468"> |
|
325
|
<rect |
|
326
|
width="148.5" |
|
327
|
height="96" |
|
328
|
fill="white" |
|
329
|
transform="translate(22.4385 -76.4437) rotate(45)" |
|
330
|
/> |
|
331
|
</clipPath> |
|
332
|
</defs> |
|
333
|
</svg> |
|
334
|
) |
|
335
|
} |