tee3apps-cms-sdk-react 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/PageComponents/BoxComponent.tsx +4 -7
- package/src/PageComponents/Visual-Components/CarouselComponent.tsx +39 -31
- package/src/PageComponents/Visual-Components/GroupBrandComponent.tsx +176 -163
- package/src/PageComponents/Visual-Components/GroupCategoryComponent.tsx +235 -222
- package/src/PageComponents/Visual-Components/GroupImageList.tsx +216 -203
- package/src/PageComponents/Visual-Components/GroupProductComponent.tsx +100 -32
- package/src/PageComponents/Visual-Components/GroupVideoList.tsx +207 -215
- package/src/PageComponents/Visual-Components/ImageComponent.tsx +3 -3
- package/src/PageComponents/Visual-Components/Styles/ProductListViewOne.tsx +54 -33
- package/src/PageComponents/Visual-Components/Styles/ProductListViewTwo.tsx +57 -32
- package/src/PageComponents/Visual-Components/TextComponent.tsx +8 -6
|
@@ -135,11 +135,11 @@ const GroupCategoryComponent: React.FC<GroupCategoryComponentMainProps> = ({ pro
|
|
|
135
135
|
const getCurrentLayout = () => {
|
|
136
136
|
if (!props.layout) return 'NONE';
|
|
137
137
|
switch (deviceMode) {
|
|
138
|
-
case 'mobileweb': return props.layout.mobileweb
|
|
139
|
-
case 'mobileapp': return props.layout.mobileapp
|
|
140
|
-
case 'tablet': return props.layout.tablet
|
|
138
|
+
case 'mobileweb': return props.layout.mobileweb;
|
|
139
|
+
case 'mobileapp': return props.layout.mobileapp;
|
|
140
|
+
case 'tablet': return props.layout.tablet;
|
|
141
141
|
case 'web':
|
|
142
|
-
default: return props.layout.web
|
|
142
|
+
default: return props.layout.web;
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
|
|
@@ -186,247 +186,260 @@ const GroupCategoryComponent: React.FC<GroupCategoryComponentMainProps> = ({ pro
|
|
|
186
186
|
};
|
|
187
187
|
|
|
188
188
|
const buildCategoryHref = (item: CategoryItem): string | null => {
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
if (item.pages && item.pages.length > 0) {
|
|
190
|
+
const firstPage = item.pages[0];
|
|
191
191
|
console.log(firstPage.page_id);
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
// No valid active page — don't return href
|
|
199
|
-
return null;
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
const Card = ({ item, large = false }: { item: CategoryItem; large?: boolean }) => {
|
|
203
|
-
const href = buildCategoryHref(item);
|
|
204
|
-
const Wrapper: React.FC<{ children: React.ReactNode }> = ({ children }) =>
|
|
205
|
-
href ? (
|
|
206
|
-
<a href={href} style={{ textDecoration: 'none', color: 'inherit', height: '100%', display: 'block' }}>
|
|
207
|
-
{children}
|
|
208
|
-
</a>
|
|
209
|
-
) : (
|
|
210
|
-
<>{children}</>
|
|
211
|
-
);
|
|
212
|
-
return (
|
|
213
|
-
<Wrapper>
|
|
214
|
-
<div
|
|
215
|
-
className="categoryCard"
|
|
216
|
-
style={{
|
|
217
|
-
height: '100%',
|
|
218
|
-
borderRadius: '8px',
|
|
219
|
-
overflow: 'hidden',
|
|
220
|
-
border: '1px solid #eee',
|
|
221
|
-
backgroundColor: '#fff',
|
|
222
|
-
display: 'flex',
|
|
223
|
-
flexDirection: 'column',
|
|
224
|
-
alignItems: 'center',
|
|
225
|
-
justifyContent: 'flex-start',
|
|
226
|
-
padding: large ? '16px' : '12px',
|
|
227
|
-
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
|
|
228
|
-
transition: 'transform 0.2s ease',
|
|
229
|
-
cursor: href ? 'pointer' : 'default',
|
|
230
|
-
}}
|
|
231
|
-
onMouseOver={(e) => {
|
|
232
|
-
(e.currentTarget as HTMLDivElement).style.transform = 'translateY(-2px)';
|
|
233
|
-
(e.currentTarget as HTMLDivElement).style.boxShadow = '0 4px 8px rgba(0,0,0,0.15)';
|
|
234
|
-
}}
|
|
235
|
-
onMouseOut={(e) => {
|
|
236
|
-
(e.currentTarget as HTMLDivElement).style.transform = 'translateY(0)';
|
|
237
|
-
(e.currentTarget as HTMLDivElement).style.boxShadow = '0 2px 4px rgba(0,0,0,0.1)';
|
|
238
|
-
}}
|
|
239
|
-
>
|
|
240
|
-
{item.image && (
|
|
241
|
-
<div
|
|
242
|
-
style={{
|
|
243
|
-
height: large ? '160px' : '120px',
|
|
244
|
-
width: '100%',
|
|
245
|
-
display: 'flex',
|
|
246
|
-
alignItems: 'center',
|
|
247
|
-
justifyContent: 'center',
|
|
248
|
-
marginBottom: large ? '12px' : '8px',
|
|
249
|
-
}}
|
|
250
|
-
>
|
|
251
|
-
<img
|
|
252
|
-
src={getImageUrl(item.image.url)}
|
|
253
|
-
alt={item.image.alt || getCategoryName(item.name) || ''}
|
|
254
|
-
style={{ width: '100%', height: '100%', objectFit: 'contain' }}
|
|
255
|
-
/>
|
|
256
|
-
</div>
|
|
257
|
-
)}
|
|
192
|
+
// Return only if page is active
|
|
193
|
+
if (firstPage.page_id) {
|
|
194
|
+
return `/page/${encodeURIComponent(firstPage.page_id)}?type=category`;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
258
197
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
textAlign: 'center',
|
|
263
|
-
fontSize: large ? '16px' : '14px',
|
|
264
|
-
fontWeight: large ? 600 : 500,
|
|
265
|
-
color: '#333',
|
|
266
|
-
lineHeight: '1.4',
|
|
267
|
-
height: large ? 'auto' : '40px',
|
|
268
|
-
overflow: 'hidden',
|
|
269
|
-
display: large ? 'block' : '-webkit-box',
|
|
270
|
-
WebkitLineClamp: large ? undefined : 2,
|
|
271
|
-
WebkitBoxOrient: 'vertical',
|
|
272
|
-
}}
|
|
273
|
-
>
|
|
274
|
-
{getCategoryName(item.name)}
|
|
275
|
-
</div>
|
|
276
|
-
)}
|
|
277
|
-
</div>
|
|
278
|
-
</Wrapper>
|
|
279
|
-
);
|
|
280
|
-
};
|
|
198
|
+
// No valid active page — don't return href
|
|
199
|
+
return null;
|
|
200
|
+
};
|
|
281
201
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
display: 'flex',
|
|
295
|
-
flexDirection: 'column',
|
|
296
|
-
height: '100%'
|
|
297
|
-
}}
|
|
298
|
-
className='GroupCategoryComponent'
|
|
299
|
-
>
|
|
300
|
-
{showHeader && (
|
|
202
|
+
const Card = ({ item, large = false }: { item: CategoryItem; large?: boolean }) => {
|
|
203
|
+
const href = buildCategoryHref(item);
|
|
204
|
+
const Wrapper: React.FC<{ children: React.ReactNode }> = ({ children }) =>
|
|
205
|
+
href ? (
|
|
206
|
+
<a href={href} style={{ textDecoration: 'none', color: 'inherit', height: '100%', display: 'block' }}>
|
|
207
|
+
{children}
|
|
208
|
+
</a>
|
|
209
|
+
) : (
|
|
210
|
+
<>{children}</>
|
|
211
|
+
);
|
|
212
|
+
return (
|
|
213
|
+
<Wrapper>
|
|
301
214
|
<div
|
|
302
|
-
className="
|
|
215
|
+
className="categoryCard"
|
|
303
216
|
style={{
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
217
|
+
height: '100%',
|
|
218
|
+
borderRadius: '8px',
|
|
219
|
+
overflow: 'hidden',
|
|
220
|
+
border: '1px solid #eee',
|
|
221
|
+
backgroundColor: '#fff',
|
|
308
222
|
display: 'flex',
|
|
223
|
+
flexDirection: 'column',
|
|
309
224
|
alignItems: 'center',
|
|
310
|
-
justifyContent: '
|
|
311
|
-
|
|
312
|
-
|
|
225
|
+
justifyContent: 'flex-start',
|
|
226
|
+
padding: large ? '16px' : '12px',
|
|
227
|
+
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
|
|
228
|
+
transition: 'transform 0.2s ease',
|
|
229
|
+
cursor: href ? 'pointer' : 'default',
|
|
230
|
+
}}
|
|
231
|
+
onMouseOver={(e) => {
|
|
232
|
+
(e.currentTarget as HTMLDivElement).style.transform = 'translateY(-2px)';
|
|
233
|
+
(e.currentTarget as HTMLDivElement).style.boxShadow = '0 4px 8px rgba(0,0,0,0.15)';
|
|
234
|
+
}}
|
|
235
|
+
onMouseOut={(e) => {
|
|
236
|
+
(e.currentTarget as HTMLDivElement).style.transform = 'translateY(0)';
|
|
237
|
+
(e.currentTarget as HTMLDivElement).style.boxShadow = '0 2px 4px rgba(0,0,0,0.1)';
|
|
313
238
|
}}
|
|
314
239
|
>
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
240
|
+
{item.image && (
|
|
241
|
+
<div
|
|
242
|
+
style={{
|
|
243
|
+
height: large ? '160px' : '120px',
|
|
244
|
+
width: '100%',
|
|
245
|
+
display: 'flex',
|
|
246
|
+
alignItems: 'center',
|
|
247
|
+
justifyContent: 'center',
|
|
248
|
+
marginBottom: large ? '12px' : '8px',
|
|
249
|
+
}}
|
|
250
|
+
>
|
|
251
|
+
<img
|
|
252
|
+
src={getImageUrl(item.image.url)}
|
|
253
|
+
alt={item.image.alt || getCategoryName(item.name) || ''}
|
|
254
|
+
style={{ width: '100%', height: '100%', objectFit: 'contain' }}
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
)}
|
|
325
258
|
|
|
326
|
-
{
|
|
327
|
-
<div
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}}
|
|
343
|
-
onMouseOver={(e) => { e.currentTarget.style.backgroundColor = '#f8f9fa'; }}
|
|
344
|
-
onMouseOut={(e) => { e.currentTarget.style.backgroundColor = '#fff'; }}
|
|
345
|
-
>
|
|
346
|
-
‹
|
|
347
|
-
</button>
|
|
348
|
-
<button
|
|
349
|
-
onClick={scrollRight}
|
|
350
|
-
style={{
|
|
351
|
-
width: '32px',
|
|
352
|
-
height: '32px',
|
|
353
|
-
borderRadius: '50%',
|
|
354
|
-
border: '1px solid #ddd',
|
|
355
|
-
backgroundColor: '#fff',
|
|
356
|
-
cursor: 'pointer',
|
|
357
|
-
display: 'flex',
|
|
358
|
-
alignItems: 'center',
|
|
359
|
-
justifyContent: 'center',
|
|
360
|
-
fontSize: '16px',
|
|
361
|
-
fontWeight: 'bold'
|
|
362
|
-
}}
|
|
363
|
-
onMouseOver={(e) => { e.currentTarget.style.backgroundColor = '#f8f9fa'; }}
|
|
364
|
-
onMouseOut={(e) => { e.currentTarget.style.backgroundColor = '#fff'; }}
|
|
365
|
-
>
|
|
366
|
-
›
|
|
367
|
-
</button>
|
|
259
|
+
{showCategoryName && (
|
|
260
|
+
<div
|
|
261
|
+
style={{
|
|
262
|
+
textAlign: 'center',
|
|
263
|
+
fontSize: large ? '16px' : '14px',
|
|
264
|
+
fontWeight: large ? 600 : 500,
|
|
265
|
+
color: '#333',
|
|
266
|
+
lineHeight: '1.4',
|
|
267
|
+
height: large ? 'auto' : '40px',
|
|
268
|
+
overflow: 'hidden',
|
|
269
|
+
display: large ? 'block' : '-webkit-box',
|
|
270
|
+
WebkitLineClamp: large ? undefined : 2,
|
|
271
|
+
WebkitBoxOrient: 'vertical',
|
|
272
|
+
}}
|
|
273
|
+
>
|
|
274
|
+
{getCategoryName(item.name)}
|
|
368
275
|
</div>
|
|
369
276
|
)}
|
|
370
277
|
</div>
|
|
371
|
-
|
|
278
|
+
</Wrapper>
|
|
279
|
+
);
|
|
280
|
+
};
|
|
372
281
|
|
|
282
|
+
return (
|
|
283
|
+
<>
|
|
284
|
+
<style>
|
|
285
|
+
{`
|
|
286
|
+
.groupCategoryCarousel::-webkit-scrollbar {
|
|
287
|
+
display: none;
|
|
288
|
+
}
|
|
289
|
+
.groupCategoryCarousel {
|
|
290
|
+
scrollbar-width: none;
|
|
291
|
+
-ms-overflow-style: none;
|
|
292
|
+
}
|
|
293
|
+
`}
|
|
294
|
+
</style>
|
|
373
295
|
<div
|
|
374
296
|
style={{
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
padding: '12px',
|
|
381
|
-
scrollBehavior: 'smooth',
|
|
382
|
-
backgroundColor: props.carouselBackground || '#fff',
|
|
383
|
-
borderRadius: '8px',
|
|
297
|
+
border: '1px solid #e1e1e1',
|
|
298
|
+
width: '100%',
|
|
299
|
+
maxWidth: '100%',
|
|
300
|
+
borderRadius: '0px',
|
|
301
|
+
minHeight: '100px',
|
|
384
302
|
position: 'relative',
|
|
385
|
-
|
|
386
|
-
|
|
303
|
+
overflow: 'visible',
|
|
304
|
+
marginBottom: '20px',
|
|
305
|
+
marginTop: '0px',
|
|
306
|
+
display: 'flex',
|
|
307
|
+
flexDirection: 'column',
|
|
308
|
+
height: '100%'
|
|
387
309
|
}}
|
|
388
|
-
className=
|
|
310
|
+
className='GroupCategoryComponent'
|
|
389
311
|
>
|
|
390
|
-
{
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
312
|
+
{showHeader && (
|
|
313
|
+
<div
|
|
314
|
+
className="groupCategoryHeader"
|
|
315
|
+
style={{
|
|
316
|
+
backgroundColor: props.headerBackground,
|
|
317
|
+
padding: '12px 16px',
|
|
318
|
+
borderRadius: '0px',
|
|
319
|
+
marginBottom: '4px',
|
|
320
|
+
display: 'flex',
|
|
321
|
+
alignItems: 'center',
|
|
322
|
+
justifyContent: 'space-between',
|
|
323
|
+
flexWrap: 'wrap',
|
|
324
|
+
gap: '12px',
|
|
325
|
+
}}
|
|
326
|
+
>
|
|
327
|
+
<p style={{
|
|
328
|
+
color: props.headerTextStyle.fontColor,
|
|
329
|
+
fontSize: `${props.headerTextStyle.fontSize}px`,
|
|
330
|
+
fontWeight: props.headerTextStyle.isBold ? 'bold' : 'normal',
|
|
331
|
+
fontStyle: props.headerTextStyle.isItalic ? 'italic' : 'normal',
|
|
332
|
+
textDecoration: props.headerTextStyle.isUnderline ? 'underline' : 'none',
|
|
333
|
+
margin: 0
|
|
334
|
+
}}>
|
|
335
|
+
{props.nameData || 'Categories'}
|
|
336
|
+
</p>
|
|
337
|
+
|
|
338
|
+
{currentLayout === 'NONE' && categories.length > 0 && (
|
|
339
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
340
|
+
<button
|
|
341
|
+
onClick={scrollLeft}
|
|
342
|
+
style={{
|
|
343
|
+
width: '32px',
|
|
344
|
+
height: '32px',
|
|
345
|
+
borderRadius: '50%',
|
|
346
|
+
border: '1px solid #ddd',
|
|
347
|
+
backgroundColor: '#fff',
|
|
348
|
+
cursor: 'pointer',
|
|
349
|
+
display: 'flex',
|
|
350
|
+
alignItems: 'center',
|
|
351
|
+
justifyContent: 'center',
|
|
352
|
+
fontSize: '16px',
|
|
353
|
+
fontWeight: 'bold'
|
|
354
|
+
}}
|
|
355
|
+
onMouseOver={(e) => { e.currentTarget.style.backgroundColor = '#f8f9fa'; }}
|
|
356
|
+
onMouseOut={(e) => { e.currentTarget.style.backgroundColor = '#fff'; }}
|
|
357
|
+
>
|
|
358
|
+
‹
|
|
359
|
+
</button>
|
|
360
|
+
<button
|
|
361
|
+
onClick={scrollRight}
|
|
362
|
+
style={{
|
|
363
|
+
width: '32px',
|
|
364
|
+
height: '32px',
|
|
365
|
+
borderRadius: '50%',
|
|
366
|
+
border: '1px solid #ddd',
|
|
367
|
+
backgroundColor: '#fff',
|
|
368
|
+
cursor: 'pointer',
|
|
369
|
+
display: 'flex',
|
|
370
|
+
alignItems: 'center',
|
|
371
|
+
justifyContent: 'center',
|
|
372
|
+
fontSize: '16px',
|
|
373
|
+
fontWeight: 'bold'
|
|
374
|
+
}}
|
|
375
|
+
onMouseOver={(e) => { e.currentTarget.style.backgroundColor = '#f8f9fa'; }}
|
|
376
|
+
onMouseOut={(e) => { e.currentTarget.style.backgroundColor = '#fff'; }}
|
|
377
|
+
>
|
|
378
|
+
›
|
|
379
|
+
</button>
|
|
395
380
|
</div>
|
|
396
|
-
)
|
|
397
|
-
) : currentLayout === 'SMALL' ? (
|
|
398
|
-
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '16px', padding: '8px' }}>
|
|
399
|
-
{categories.map((category) => (
|
|
400
|
-
<Card key={category.code} item={category} />
|
|
401
|
-
))}
|
|
402
|
-
</div>
|
|
403
|
-
) : currentLayout === 'MEDIUM' ? (
|
|
404
|
-
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '16px', padding: '8px' }}>
|
|
405
|
-
{categories.map((category) => (
|
|
406
|
-
<Card key={category.code} item={category} />
|
|
407
|
-
))}
|
|
408
|
-
</div>
|
|
409
|
-
) : currentLayout === 'MEDIUM_THREE' ? (
|
|
410
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px', padding: '8px' }}>
|
|
411
|
-
{categories.length > 0 && (
|
|
412
|
-
<Card item={categories[0]} large />
|
|
413
|
-
)}
|
|
414
|
-
{categories.length > 1 && (
|
|
415
|
-
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '16px' }}>
|
|
416
|
-
{categories.slice(1).map((category) => (
|
|
417
|
-
<Card key={category.code} item={category} />
|
|
418
|
-
))}
|
|
419
|
-
</div>
|
|
420
|
-
)}
|
|
421
|
-
</div>
|
|
422
|
-
) : null
|
|
423
|
-
) : (
|
|
424
|
-
<div style={{ textAlign: 'center', color: '#666', padding: '40px', width: '100%', border: '2px dashed #ddd', borderRadius: '8px', backgroundColor: '#f9f9f9' }}>
|
|
425
|
-
<p>No categories available.</p>
|
|
381
|
+
)}
|
|
426
382
|
</div>
|
|
427
383
|
)}
|
|
384
|
+
|
|
385
|
+
<div
|
|
386
|
+
style={{
|
|
387
|
+
display: currentLayout === 'NONE' ? 'flex' : 'block',
|
|
388
|
+
overflowX: currentLayout === 'NONE' ? (isHorizontalScroll ? 'auto' : 'hidden') : 'visible',
|
|
389
|
+
overflowY: currentLayout === 'NONE' ? 'hidden' : 'visible',
|
|
390
|
+
alignItems: currentLayout === 'NONE' ? 'stretch' : undefined,
|
|
391
|
+
gap: currentLayout === 'NONE' ? '12px' : '0',
|
|
392
|
+
padding: '12px',
|
|
393
|
+
scrollBehavior: 'smooth',
|
|
394
|
+
backgroundColor: props.carouselBackground || '#fff',
|
|
395
|
+
borderRadius: '8px',
|
|
396
|
+
position: 'relative',
|
|
397
|
+
flex: 1,
|
|
398
|
+
minHeight: 0,
|
|
399
|
+
}}
|
|
400
|
+
className="groupCategoryCarousel"
|
|
401
|
+
>
|
|
402
|
+
{categories.length > 0 ? (
|
|
403
|
+
currentLayout === 'NONE' ? (
|
|
404
|
+
categories.map((category) => (
|
|
405
|
+
<div key={category.code} style={{ minWidth: '150px', width: '150px', flexShrink: 0, display: 'flex', flexDirection: 'column', height: '100%' }}>
|
|
406
|
+
<Card item={category} />
|
|
407
|
+
</div>
|
|
408
|
+
))
|
|
409
|
+
) : currentLayout === 'SMALL' ? (
|
|
410
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '16px', padding: '8px' }}>
|
|
411
|
+
{categories.map((category) => (
|
|
412
|
+
<Card key={category.code} item={category} />
|
|
413
|
+
))}
|
|
414
|
+
</div>
|
|
415
|
+
) : currentLayout === 'MEDIUM' ? (
|
|
416
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '16px', padding: '8px' }}>
|
|
417
|
+
{categories.map((category) => (
|
|
418
|
+
<Card key={category.code} item={category} />
|
|
419
|
+
))}
|
|
420
|
+
</div>
|
|
421
|
+
) : currentLayout === 'MEDIUM_THREE' ? (
|
|
422
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px', padding: '8px' }}>
|
|
423
|
+
{categories.length > 0 && (
|
|
424
|
+
<Card item={categories[0]} large />
|
|
425
|
+
)}
|
|
426
|
+
{categories.length > 1 && (
|
|
427
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '16px' }}>
|
|
428
|
+
{categories.slice(1).map((category) => (
|
|
429
|
+
<Card key={category.code} item={category} />
|
|
430
|
+
))}
|
|
431
|
+
</div>
|
|
432
|
+
)}
|
|
433
|
+
</div>
|
|
434
|
+
) : null
|
|
435
|
+
) : (
|
|
436
|
+
<div style={{ textAlign: 'center', color: '#666', padding: '40px', width: '100%', border: '2px dashed #ddd', borderRadius: '8px', backgroundColor: '#f9f9f9' }}>
|
|
437
|
+
<p>No categories available.</p>
|
|
438
|
+
</div>
|
|
439
|
+
)}
|
|
440
|
+
</div>
|
|
428
441
|
</div>
|
|
429
|
-
|
|
442
|
+
</>
|
|
430
443
|
);
|
|
431
444
|
};
|
|
432
445
|
|