kupos-ui-components-lib 9.9.7 → 9.9.9

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.
Files changed (35) hide show
  1. package/dist/KuposUIComponent.d.ts +3 -0
  2. package/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
  3. package/dist/components/ServiceItem/PeruServiceItemDesktop.js +156 -176
  4. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  5. package/dist/components/ServiceItem/ServiceItemDesktop.js +28 -12
  6. package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
  7. package/dist/components/ServiceItem/ServiceItemMobile.js +45 -17
  8. package/dist/components/ServiceItem/mobileTypes.d.ts +48 -0
  9. package/dist/components/ServiceItem/types.d.ts +27 -1
  10. package/dist/styles.css +219 -13
  11. package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +1 -2
  12. package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +2 -4
  13. package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +3 -10
  14. package/dist/ui/OfferBanner.d.ts +2 -0
  15. package/dist/ui/OfferBanner.js +22 -15
  16. package/dist/ui/SeatSection/SeatSection.js +3 -3
  17. package/dist/utils/CommonService.d.ts +3 -0
  18. package/dist/utils/CommonService.js +18 -1
  19. package/package.json +1 -1
  20. package/src/KuposUIComponent.tsx +3 -0
  21. package/src/assets/images/anims/service_list/flame_anim.json +1 -0
  22. package/src/assets/images/anims/service_list/thunder_icon.json +1 -0
  23. package/src/assets/images/anims/service_list/users_anim.json +1 -0
  24. package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +404 -277
  25. package/src/components/ServiceItem/ServiceItemDesktop.tsx +71 -8
  26. package/src/components/ServiceItem/ServiceItemMobile.tsx +374 -271
  27. package/src/components/ServiceItem/mobileTypes.ts +48 -0
  28. package/src/components/ServiceItem/types.ts +32 -1
  29. package/src/styles.css +15 -0
  30. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +2 -4
  31. package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +575 -0
  32. package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +634 -0
  33. package/src/ui/OfferBanner.tsx +71 -43
  34. package/src/ui/SeatSection/SeatSection.tsx +3 -3
  35. package/src/utils/CommonService.ts +26 -1
@@ -9,6 +9,7 @@ import SeatSectionMobile from "../../ui/mobileweb/SeatSectionMobile";
9
9
  import DateTimeSectionMobile from "../../ui/mobileweb/DateTimeSectionMobile";
10
10
  import ExpandedDropdownMobile from "../../ui/mobileweb/ExpandedDropdownMobile";
11
11
  import ServiceBadgesMobile from "../../ui/mobileweb/ServiceBadgesMobile";
12
+ import FeatureServiceUiMobile from "../../ui/FeaturServiceUiMobile/FeatureServiceUiMobile";
12
13
 
13
14
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
14
15
 
@@ -47,9 +48,25 @@ function ServiceItemMobile({
47
48
  viewersConfig,
48
49
  operatorLabel,
49
50
  isTrain,
51
+ isFeatureDropDownExpand,
52
+ setIsFeatureDropDownExpand,
53
+ ticketQuantity,
54
+ onIncreaseTicketQuantity,
55
+ onDecreaseTicketQuantity,
56
+ cityOrigin,
57
+ cityDestination,
58
+ isNewUi,
59
+ onRemateUiButtonClick,
60
+ selectedTimeSlot,
61
+ onTimeSlotChange,
62
+ isTimeDropdownOpen,
63
+ onTimeDropdownToggle,
64
+ wowDealData,
65
+ isFlores,
50
66
  }: MobileServiceItemProps): React.ReactElement {
51
67
  const isItemExpanded = serviceItem.id === isExpanded;
52
68
  const isPetSeat = (Object.keys(serviceItem?.pet_seat_info) || []).length > 0;
69
+ const isNewUiEnabled = serviceItem?.discounts?.[0]?.new_ui_enabled === true;
53
70
  let isSoldOut = serviceItem.available_seats <= 0;
54
71
 
55
72
  const seats = removeDuplicateSeats
@@ -74,7 +91,7 @@ function ServiceItemMobile({
74
91
  const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
75
92
  const offerGradientWithOpacity = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"}80 0%, ${colors.leftGradiantColor || "#ff8842"}80 100%)`;
76
93
  const serviceCardStyle: React.CSSProperties =
77
- hasOfferText || serviceItem?.is_dp_enabled
94
+ (hasOfferText && isNewUiEnabled) || serviceItem?.is_dp_enabled
78
95
  ? {
79
96
  borderColor: isSoldOut ? "#ccc" : "transparent",
80
97
  borderStyle: "solid",
@@ -155,211 +172,231 @@ function ServiceItemMobile({
155
172
  }
156
173
 
157
174
  return (
158
- <div
159
- className={`relative ${!serviceItem.offer_text || !serviceItem?.is_dp_enabled ? "mb-[14px]" : showTopLabel || serviceItem?.is_direct_trip ? "mb-[20px]" : "mb-[12px]"} ${
160
- serviceItem?.is_direct_trip ||
161
- isConexion ||
162
- serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
163
- showTopLabel
164
- ? "mt-[20px]"
165
- : "mt-[10px]"
166
- } `}
167
- style={{ zIndex: 1 }}
168
- >
169
- <div
170
- className={`z-1 ${
171
- (hasOfferText || serviceItem?.is_dp_enabled) && !isSoldOut
172
- ? "rounded-[18px]"
173
- : "rounded-[10px] border border-[#ccc]"
174
- }`}
175
- style={{ ...serviceCardStyle, backgroundColor: "#fff" }}
176
- >
177
- <div style={{ padding: "12px 12px 8px 12px" }}>
178
- {/* Header with operator info and favorite */}
179
- <div className="flex justify-between items-center mb-[10px]">
180
- <div
181
- className="flex items-center justify-center gap-x-4"
182
- style={{
183
- marginBottom:
184
- serviceItem?.offer_text || hasDiscount ? "10px" : "",
185
- }}
186
- >
187
- <div className="w-[115px] overflow-y-hidden h-[22px]">
188
- <img
189
- src={serviceItem.operator_details[0]}
190
- alt="service logo"
191
- className={`w-[100px] h-auto object-contain ${
192
- isSoldOut ? "grayscale" : ""
193
- }`}
194
- />
195
- </div>
196
- {isCiva ? (
197
- <div className="black-text min-[420]:text-[12px] text-[12px]">
198
- {serviceItem?.operator_details[2]}
199
- </div>
200
- ) : showRating ? (
201
- <div className="flex min-[420]:text-[13px] text-[12px] h-[22px] items-center">
202
- <div className="flex items-center">
203
- <div className="flex items-center">
204
- <img
205
- src={serviceItem.icons.rating}
206
- alt="origin"
207
- className={`w-[12px] h-[12px] mr-[4px] object-contain ${
208
- isSoldOut ? "grayscale" : ""
209
- }`}
210
- />
211
- <span style={{ lineHeight: "normal" }}>
212
- {getServiceStars(serviceItem)}
213
- </span>
175
+ <>
176
+ {isNewUi ? (
177
+ <FeatureServiceUiMobile
178
+ serviceItem={serviceItem}
179
+ showTopLabel={showTopLabel}
180
+ colors={colors}
181
+ isSoldOut={isSoldOut}
182
+ cityOrigin={cityOrigin}
183
+ cityDestination={cityDestination}
184
+ renderIcon={renderIcon}
185
+ viewersConfig={viewersConfig}
186
+ isFeatureDropDownExpand={isFeatureDropDownExpand}
187
+ ticketQuantity={ticketQuantity}
188
+ onIncreaseTicketQuantity={onIncreaseTicketQuantity}
189
+ onDecreaseTicketQuantity={onDecreaseTicketQuantity}
190
+ onBookButtonPress={onRemateUiButtonClick}
191
+ onToggleExpand={() =>
192
+ setIsFeatureDropDownExpand &&
193
+ setIsFeatureDropDownExpand(
194
+ isFeatureDropDownExpand === serviceItem.id ||
195
+ isFeatureDropDownExpand === true
196
+ ? null
197
+ : serviceItem.id,
198
+ )
199
+ }
200
+ selectedTimeSlot={selectedTimeSlot}
201
+ onTimeSlotChange={onTimeSlotChange}
202
+ isTimeDropdownOpen={isTimeDropdownOpen}
203
+ onTimeDropdownToggle={onTimeDropdownToggle}
204
+ wowDealData={wowDealData}
205
+ />
206
+ ) : (
207
+ <div
208
+ className={`relative ${!serviceItem.offer_text || !serviceItem?.is_dp_enabled ? "mb-[14px]" : showTopLabel || serviceItem?.is_direct_trip ? "mb-[20px]" : "mb-[12px]"} ${
209
+ serviceItem?.is_direct_trip ||
210
+ isConexion ||
211
+ serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
212
+ showTopLabel
213
+ ? "mt-[20px]"
214
+ : "mt-[10px]"
215
+ } `}
216
+ style={{ zIndex: 1 }}
217
+ >
218
+ <div
219
+ className={`z-1 ${
220
+ ((hasOfferText && isNewUiEnabled) ||
221
+ serviceItem?.is_dp_enabled) &&
222
+ !isSoldOut
223
+ ? "rounded-[18px]"
224
+ : "rounded-[10px] border border-[#ccc]"
225
+ }`}
226
+ style={{ ...serviceCardStyle, backgroundColor: "#fff" }}
227
+ >
228
+ <div style={{ padding: "12px 12px 8px 12px" }}>
229
+ {/* Header with operator info and favorite */}
230
+ <div className="flex justify-between items-center mb-[10px]">
231
+ <div
232
+ className="flex items-center justify-center gap-x-4"
233
+ style={{
234
+ marginBottom:
235
+ serviceItem?.offer_text || hasDiscount ? "10px" : "",
236
+ }}
237
+ >
238
+ <div
239
+ className={`w-[115px] ${isFlores ? "" : "overflow-y-hidden"} h-[22px]`}
240
+ >
241
+ <img
242
+ src={serviceItem.operator_details[0]}
243
+ alt="service logo"
244
+ className={`w-[100px] h-auto object-contain ${
245
+ isSoldOut ? "grayscale" : ""
246
+ }`}
247
+ />
248
+ </div>
249
+ {isCiva ? (
250
+ <div className="black-text min-[420]:text-[12px] text-[12px]">
251
+ {serviceItem?.operator_details[2]}
214
252
  </div>
253
+ ) : showRating ? (
254
+ <div className="flex min-[420]:text-[13px] text-[12px] h-[22px] items-center">
255
+ <div className="flex items-center">
256
+ <div className="flex items-center">
257
+ <img
258
+ src={serviceItem.icons.rating}
259
+ alt="origin"
260
+ className={`w-[12px] h-[12px] mr-[4px] object-contain ${
261
+ isSoldOut ? "grayscale" : ""
262
+ }`}
263
+ />
264
+ <span style={{ lineHeight: "normal" }}>
265
+ {getServiceStars(serviceItem)}
266
+ </span>
267
+ </div>
215
268
 
216
- <div
217
- className="flex items-center cursor-pointer "
218
- style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
219
- >
220
- <span className="ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis overflow-hidden whitespace-nowrap max-w-[120px]">
221
- {serviceItem.operator_details[2]}
222
- </span>
269
+ <div
270
+ className="flex items-center cursor-pointer "
271
+ style={{
272
+ color: isSoldOut ? "#bbb" : "text-[#464647]",
273
+ }}
274
+ >
275
+ <span className="ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis overflow-hidden whitespace-nowrap max-w-[120px]">
276
+ {serviceItem.operator_details[2]}
277
+ </span>
278
+ </div>
279
+ </div>
223
280
  </div>
224
- </div>
281
+ ) : null}
225
282
  </div>
226
- ) : null}
227
- </div>
228
- </div>
283
+ </div>
229
284
 
230
- <DateTimeSectionMobile
231
- onBookButtonPress={onBookButtonPress}
232
- isCiva={isCiva}
233
- isSoldOut={isSoldOut}
234
- isLinatal={isLinatal}
235
- isPeru={isPeru}
236
- orignLabel={orignLabel}
237
- destinationLabel={destinationLabel}
238
- originIcon={serviceItem.icons?.origin}
239
- destinationIcon={serviceItem.icons?.destination}
240
- travelDate={serviceItem.travel_date}
241
- arrivalDate={serviceItem.arrival_date}
242
- depTime={serviceItem.dep_time}
243
- arrTime={serviceItem.arr_time}
244
- seatTypes={serviceItem.seat_types}
245
- seatPriceColor={colors.seatPriceColor}
246
- tooltipBgColor={colors.tooltipBgColor}
247
- currencySign={currencySign}
248
- availableSeats={serviceItem.available_seats}
249
- removeDuplicateSeats={removeDuplicateSeats}
250
- serviceItem={serviceItem}
251
- showLastSeats={showLastSeats}
252
- discountSeatPriceColor={colors.discountSeatPriceColor}
253
- isTrain={isTrain}
254
- />
285
+ <DateTimeSectionMobile
286
+ onBookButtonPress={onBookButtonPress}
287
+ isCiva={isCiva}
288
+ isSoldOut={isSoldOut}
289
+ isLinatal={isLinatal}
290
+ isPeru={isPeru}
291
+ orignLabel={orignLabel}
292
+ destinationLabel={destinationLabel}
293
+ originIcon={serviceItem.icons?.origin}
294
+ destinationIcon={serviceItem.icons?.destination}
295
+ travelDate={serviceItem.travel_date}
296
+ arrivalDate={serviceItem.arrival_date}
297
+ depTime={serviceItem.dep_time}
298
+ arrTime={serviceItem.arr_time}
299
+ seatTypes={serviceItem.seat_types}
300
+ seatPriceColor={colors.seatPriceColor}
301
+ tooltipBgColor={colors.tooltipBgColor}
302
+ currencySign={currencySign}
303
+ availableSeats={serviceItem.available_seats}
304
+ removeDuplicateSeats={removeDuplicateSeats}
305
+ serviceItem={serviceItem}
306
+ showLastSeats={showLastSeats}
307
+ discountSeatPriceColor={colors.discountSeatPriceColor}
308
+ />
255
309
 
256
- {hasDiscount && (
257
- <div className="flex justify-end">
258
- {isSoldOut ? (
259
- <span className="col-span-2 min-[420]:text-[13px] text-right text-[12px] text-[#ccc]">
260
- Agotado
261
- </span>
262
- ) : null}
263
- </div>
264
- )}
310
+ {hasDiscount && (
311
+ <div className="flex justify-end">
312
+ {isSoldOut ? (
313
+ <span className="col-span-2 min-[420]:text-[13px] text-right text-[12px] text-[#ccc]">
314
+ Agotado
315
+ </span>
316
+ ) : null}
317
+ </div>
318
+ )}
265
319
 
266
- {showLastSeats ? (
267
- <div className="flex justify-end ">
268
- {serviceItem?.available_seats < 10 &&
269
- serviceItem?.available_seats > 0 && (
270
- <div
271
- className="text-[10px] text-center"
272
- style={{
273
- color: colors.tooltipBgColor,
274
- }}
275
- >
276
- ¡Últimos Asientos!
277
- </div>
278
- )}
279
- </div>
280
- ) : null}
320
+ {showLastSeats ? (
321
+ <div className="flex justify-end ">
322
+ {serviceItem?.available_seats < 10 &&
323
+ serviceItem?.available_seats > 0 && (
324
+ <div
325
+ className="text-[10px] text-center"
326
+ style={{
327
+ color: colors.tooltipBgColor,
328
+ }}
329
+ >
330
+ ¡Últimos Asientos!
331
+ </div>
332
+ )}
333
+ </div>
334
+ ) : null}
281
335
 
282
- {/* <div className="bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]"></div> */}
283
- <div className="bg-[#E6E6E6] mt-[10px] mb-[8px] h-[1px]"></div>
336
+ {/* <div className="bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]"></div> */}
337
+ <div className="bg-[#E6E6E6] mt-[10px] mb-[8px] h-[1px]"></div>
284
338
 
285
- <BottomAmenitiesMobile
286
- isSoldOut={isSoldOut}
287
- amenitiesNodes={amenities()}
288
- hoursIcon={renderIcon("hours", "14px")}
289
- duration={serviceItem.duration?.toString()}
290
- isDirectTrip={serviceItem?.is_direct_trip}
291
- directoColor={colors.directoColor}
292
- directoAnim={serviceItem.icons.directoAnim}
293
- isChangeTicket={serviceItem.is_change_ticket}
294
- isPetSeat={isPetSeat}
295
- petSeatInfo={serviceItem.pet_seat_info}
296
- petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
297
- flexibleAnim={serviceItem.icons.flexibleAnim}
298
- isTrackingEnabled={serviceItem?.is_tracking_enabled}
299
- locationAnim={serviceItem.icons.locationAnim}
300
- downArrowIcon={serviceItem.icons.downArrow}
301
- showDropdown={isItemExpanded}
302
- setShowDropdown={() =>
303
- setIsExpanded(isItemExpanded ? null : serviceItem.id)
304
- }
305
- onDropdownToggle={() => {
306
- setIsExpanded(isItemExpanded ? null : serviceItem.id);
307
- }}
308
- isPeru={isPeru}
309
- femaleAnim={serviceItem.icons.femaleAnim}
310
- ladiesBookedSeats={serviceItem.ladies_booked_seats}
311
- isDpEnabled={serviceItem.is_dp_enabled}
312
- />
313
- </div>
339
+ <BottomAmenitiesMobile
340
+ isSoldOut={isSoldOut}
341
+ amenitiesNodes={amenities()}
342
+ hoursIcon={renderIcon("hours", "14px")}
343
+ duration={serviceItem.duration?.toString()}
344
+ isDirectTrip={serviceItem?.is_direct_trip}
345
+ directoColor={colors.directoColor}
346
+ directoAnim={serviceItem.icons.directoAnim}
347
+ isChangeTicket={serviceItem.is_change_ticket}
348
+ isPetSeat={isPetSeat}
349
+ petSeatInfo={serviceItem.pet_seat_info}
350
+ petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
351
+ flexibleAnim={serviceItem.icons.flexibleAnim}
352
+ isTrackingEnabled={serviceItem?.is_tracking_enabled}
353
+ locationAnim={serviceItem.icons.locationAnim}
354
+ downArrowIcon={serviceItem.icons.downArrow}
355
+ showDropdown={isItemExpanded}
356
+ setShowDropdown={() =>
357
+ setIsExpanded(isItemExpanded ? null : serviceItem.id)
358
+ }
359
+ onDropdownToggle={() => {
360
+ setIsExpanded(isItemExpanded ? null : serviceItem.id);
361
+ }}
362
+ isPeru={isPeru}
363
+ femaleAnim={serviceItem.icons.femaleAnim}
364
+ ladiesBookedSeats={serviceItem.ladies_booked_seats}
365
+ isDpEnabled={serviceItem.is_dp_enabled}
366
+ />
367
+ </div>
314
368
 
315
- <ServiceBadgesMobile
316
- showTopLabel={showTopLabel}
317
- isSoldOut={isSoldOut}
318
- colors={colors}
319
- renderIcon={renderIcon}
320
- serviceItem={serviceItem}
321
- isConexion={isConexion}
322
- />
323
- </div>
369
+ <ServiceBadgesMobile
370
+ showTopLabel={showTopLabel}
371
+ isSoldOut={isSoldOut}
372
+ colors={colors}
373
+ renderIcon={renderIcon}
374
+ serviceItem={serviceItem}
375
+ isConexion={isConexion}
376
+ />
377
+ </div>
324
378
 
325
- {/* 🔹 EXPANDABLE DROPDOWN (below the card) */}
326
- {(serviceItem?.offer_text || serviceItem?.is_dp_enabled) &&
327
- !isSoldOut && (
328
- <div
329
- className="px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]"
330
- style={{
331
- background: isSoldOut ? offerGradientWithOpacity : offerGradient,
332
- // opacity: isSoldOut ? 0.5 : 1,
333
- borderRadius: "0 0 14px 14px",
334
- zIndex: -1,
335
- }}
336
- >
379
+ {/* 🔹 EXPANDABLE DROPDOWN (below the card) */}
380
+ {serviceItem?.offer_text && !isNewUiEnabled && !isSoldOut && (
337
381
  <div
338
- className="flex flex-col gap-[8px] text-[12px] min-[420px]:text-[12px] text-[#464647]"
339
- style={{ lineHeight: 1.6 }}
382
+ className="px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]"
383
+ style={{
384
+ background: colors?.bottomStripColor,
385
+ borderRadius: "0 0 14px 14px",
386
+ zIndex: -1,
387
+ }}
340
388
  >
341
- <div className="flex justify-between items-center">
342
- {serviceItem?.is_dp_enabled &&
343
- Object.keys(serviceItem?.dp_discount_percents ?? {}).length ===
344
- 0 &&
345
- (serviceItem?.dp_discounted_seats ?? []).length === 0 ? (
346
- <div className="flex items-center gap-[6px]">
347
- {/* {renderIcon("whiteFireIcon", "14px")} */}
348
- <LottiePlayer
349
- animationData={serviceItem.icons.starAnimation}
350
- width="14px"
351
- height="14px"
352
- />
353
-
354
- <span className="text-[#fff]">Más elegido</span>
355
- </div>
356
- ) : (
389
+ <div
390
+ className="flex flex-col gap-[8px] text-[12px] min-[420px]:text-[12px] text-[#464647]"
391
+ style={{ lineHeight: 1.6 }}
392
+ >
393
+ <div className="flex justify-between items-center">
357
394
  <div
358
395
  className={`flex ${(serviceItem?.offer_text || "").length > 10 ? "items-start" : "items-center"}`}
359
396
  >
360
397
  <div className={isLongOfferText ? "mt-[2px]" : ""}>
361
398
  <LottiePlayer
362
- animationData={serviceItem.icons.bombAnim}
399
+ animationData={serviceItem.icons.promoAnim}
363
400
  width="14px"
364
401
  height="14px"
365
402
  />
@@ -372,101 +409,167 @@ function ServiceItemMobile({
372
409
  }}
373
410
  >
374
411
  <span className="whitespace-nowrap min-[380px]:text-[12px]">
375
- Termina en&nbsp;
376
- <span
377
- className="bold-text"
378
- ref={(node) =>
379
- commonService.startCountdown(node, 599)
380
- }
381
- style={{
382
- fontVariantNumeric: "tabular-nums",
383
- display: "inline-block",
384
- }}
385
- />
412
+ {serviceItem?.offer_text}
386
413
  </span>
387
414
  </div>
388
415
  </div>
389
- )}
416
+ </div>
417
+ </div>
418
+ </div>
419
+ )}
420
+
421
+ {/* 🔹 EXPANDABLE DROPDOWN (below the card) */}
422
+ {((serviceItem?.offer_text && isNewUiEnabled) ||
423
+ serviceItem?.is_dp_enabled) &&
424
+ !isSoldOut && (
425
+ <div
426
+ className="px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]"
427
+ style={{
428
+ background: isSoldOut
429
+ ? offerGradientWithOpacity
430
+ : offerGradient,
431
+ // opacity: isSoldOut ? 0.5 : 1,
432
+ borderRadius: "0 0 14px 14px",
433
+ zIndex: -1,
434
+ }}
435
+ >
390
436
  <div
391
- className="flex flex-col items-end"
392
- style={{
393
- color: "#fff",
394
- }}
437
+ className="flex flex-col gap-[8px] text-[12px] min-[420px]:text-[12px] text-[#464647]"
438
+ style={{ lineHeight: 1.6 }}
395
439
  >
396
- <div className="flex items-center">
397
- <div className="mr-[4px]">
398
- {" "}
399
- <LottiePlayer
400
- animationData={serviceItem.icons.dotAnimation}
401
- width="12px"
402
- height="12px"
403
- />
440
+ <div className="flex justify-between items-center">
441
+ {serviceItem?.is_dp_enabled &&
442
+ Object.keys(serviceItem?.dp_discount_percents ?? {})
443
+ .length === 0 &&
444
+ (serviceItem?.dp_discounted_seats ?? []).length === 0 ? (
445
+ <div className="flex items-center gap-[6px]">
446
+ {/* {renderIcon("whiteFireIcon", "14px")} */}
447
+ <LottiePlayer
448
+ animationData={serviceItem.icons.starAnimation}
449
+ width="14px"
450
+ height="14px"
451
+ />
452
+
453
+ <span className="text-[#fff]">Más elegido</span>
454
+ </div>
455
+ ) : (
456
+ <div
457
+ className={`flex ${(serviceItem?.offer_text || "").length > 10 ? "items-start" : "items-center"}`}
458
+ >
459
+ <div className={isLongOfferText ? "mt-[2px]" : ""}>
460
+ <LottiePlayer
461
+ animationData={serviceItem.icons.bombAnim}
462
+ width="14px"
463
+ height="14px"
464
+ />
465
+ </div>
466
+ <div
467
+ className={`ml-[4px] flex-1 outline-none ${isLongOfferText ? "mt-[2px]" : ""}`}
468
+ style={{
469
+ color: "#fff",
470
+ lineHeight: 1.4,
471
+ }}
472
+ >
473
+ <span className="whitespace-nowrap min-[380px]:text-[12px]">
474
+ Termina en&nbsp;
475
+ <span
476
+ className="bold-text"
477
+ ref={(node) =>
478
+ commonService.startCountdown(node, 599)
479
+ }
480
+ style={{
481
+ fontVariantNumeric: "tabular-nums",
482
+ display: "inline-block",
483
+ }}
484
+ />
485
+ </span>
486
+ </div>
487
+ </div>
488
+ )}
489
+ <div
490
+ className="flex flex-col items-end"
491
+ style={{
492
+ color: "#fff",
493
+ }}
494
+ >
495
+ <div className="flex items-center">
496
+ <div className="mr-[4px]">
497
+ {" "}
498
+ <LottiePlayer
499
+ animationData={serviceItem.icons.dotAnimation}
500
+ width="12px"
501
+ height="12px"
502
+ />
503
+ </div>
504
+ <span className="flex-1" style={{ lineHeight: 1.4 }}>
505
+ <span
506
+ className="bold-text"
507
+ ref={(node) =>
508
+ commonService.startViewerCount(
509
+ node,
510
+ viewersConfig,
511
+ )
512
+ }
513
+ style={{ fontVariantNumeric: "tabular-nums" }}
514
+ />{" "}
515
+ <span> viendo</span> |{" "}
516
+ <span className="whitespace-nowrap">
517
+ {/* {serviceItem?.is_dp_enabled ? null : "Quedan pocos • "} */}
518
+ <span
519
+ className="bold-text"
520
+ ref={(node) =>
521
+ commonService.startComprandoCount(node, 4, 16)
522
+ }
523
+ style={{ fontVariantNumeric: "tabular-nums" }}
524
+ />{" "}
525
+ comprando
526
+ </span>
527
+ </span>
528
+ </div>
404
529
  </div>
405
- <span className="flex-1" style={{ lineHeight: 1.4 }}>
406
- <span
407
- className="bold-text"
408
- ref={(node) =>
409
- commonService.startViewerCount(node, viewersConfig)
410
- }
411
- style={{ fontVariantNumeric: "tabular-nums" }}
412
- />{" "}
413
- <span> viendo</span> |{" "}
414
- <span className="whitespace-nowrap">
415
- {/* {serviceItem?.is_dp_enabled ? null : "Quedan pocos • "} */}
416
- <span
417
- className="bold-text"
418
- ref={(node) =>
419
- commonService.startComprandoCount(node, 4, 16)
420
- }
421
- style={{ fontVariantNumeric: "tabular-nums" }}
422
- />{" "}
423
- comprando
424
- </span>
425
- </span>
426
530
  </div>
427
531
  </div>
428
532
  </div>
533
+ )}
534
+ <div
535
+ style={{
536
+ display: "grid",
537
+ gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
538
+ opacity: isItemExpanded ? 1 : 0,
539
+ transition:
540
+ "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
541
+ position: "relative",
542
+ zIndex:
543
+ serviceItem?.offer_text || serviceItem?.is_dp_enabled ? -2 : -1,
544
+ }}
545
+ >
546
+ <div
547
+ style={{
548
+ overflow: "hidden",
549
+ minHeight: 0,
550
+ position: serviceItem?.offer_text ? "relative" : undefined,
551
+ zIndex: serviceItem?.offer_text ? -3 : undefined,
552
+ marginTop: serviceItem?.offer_text ? "-15px" : "-10px",
553
+ }}
554
+ >
555
+ <ExpandedDropdownMobile
556
+ serviceItem={serviceItem}
557
+ isPeru={isPeru}
558
+ petSeatInfo={serviceItem.pet_seat_info}
559
+ petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
560
+ isSoldOut={isSoldOut}
561
+ isChangeTicket={serviceItem.is_change_ticket === true}
562
+ ladiesBookedSeats={serviceItem.ladies_booked_seats}
563
+ isDpEnabled={serviceItem.is_dp_enabled}
564
+ femaleAnim={serviceItem.icons.femaleAnim}
565
+ flexibleAnim={serviceItem.icons.flexibleAnim}
566
+ renderIcon={renderIcon}
567
+ />
429
568
  </div>
430
569
  </div>
431
- )}
432
- <div
433
- style={{
434
- display: "grid",
435
- gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
436
- opacity: isItemExpanded ? 1 : 0,
437
- transition:
438
- "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
439
- position: "relative",
440
- zIndex:
441
- serviceItem?.offer_text || serviceItem?.is_dp_enabled ? -2 : -1,
442
- }}
443
- >
444
- <div
445
- style={{
446
- overflow: "hidden",
447
- minHeight: 0,
448
- position: serviceItem?.offer_text ? "relative" : undefined,
449
- zIndex: serviceItem?.offer_text ? -3 : undefined,
450
- marginTop: serviceItem?.offer_text ? "-15px" : "-10px",
451
- }}
452
- >
453
- <ExpandedDropdownMobile
454
- serviceItem={serviceItem}
455
- isPeru={isPeru}
456
- petSeatInfo={serviceItem.pet_seat_info}
457
- petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
458
- isSoldOut={isSoldOut}
459
- isChangeTicket={serviceItem.is_change_ticket === true}
460
- ladiesBookedSeats={serviceItem.ladies_booked_seats}
461
- isDpEnabled={serviceItem.is_dp_enabled}
462
- femaleAnim={serviceItem.icons.femaleAnim}
463
- flexibleAnim={serviceItem.icons.flexibleAnim}
464
- renderIcon={renderIcon}
465
- operatorLabel={operatorLabel}
466
- />
467
570
  </div>
468
- </div>
469
- </div>
571
+ )}
572
+ </>
470
573
  );
471
574
  }
472
575