kupos-ui-components-lib 9.0.7 → 9.0.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 (53) hide show
  1. package/README copy.md +223 -67
  2. package/dist/assets/images/anims/service_list/directo.json +1 -1
  3. package/dist/assets/images/anims/service_list/priority_stage.json +1 -1
  4. package/dist/components/ServiceItem/RatingHover.js +31 -31
  5. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  6. package/dist/components/ServiceItem/ServiceItemDesktop.js +124 -299
  7. package/dist/components/ServiceItem/ServiceItemMobile.js +44 -291
  8. package/dist/components/ServiceItem/mobileTypes.d.ts +3 -0
  9. package/dist/components/ServiceItem/types.d.ts +7 -0
  10. package/dist/styles.css +76 -17
  11. package/dist/ui/AmenitiesBlock.js +25 -36
  12. package/dist/ui/BottomAmenities/BottomAmenities.js +3 -2
  13. package/dist/ui/DateTimeSection/DateTimeSection.d.ts +28 -0
  14. package/dist/ui/DateTimeSection/DateTimeSection.js +58 -0
  15. package/dist/ui/DirectoBlock.d.ts +8 -0
  16. package/dist/ui/DirectoBlock.js +11 -0
  17. package/dist/ui/DurationBlock.js +2 -2
  18. package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +1 -0
  19. package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +28 -18
  20. package/dist/ui/FlexibleBlock.js +2 -4
  21. package/dist/ui/PetBlock.js +1 -3
  22. package/dist/ui/RatingBlock.js +6 -2
  23. package/dist/ui/SeatSection/SeatSection.js +1 -1
  24. package/dist/ui/TopAmenities/PromoCountdown.d.ts +18 -0
  25. package/dist/ui/TopAmenities/PromoCountdown.js +55 -0
  26. package/dist/ui/TopAmenities/TopAmenities.d.ts +4 -1
  27. package/dist/ui/TopAmenities/TopAmenities.js +31 -4
  28. package/dist/utils/CommonService.d.ts +1 -1
  29. package/package.json +2 -1
  30. package/src/assets/images/anims/service_list/bomb.json +1 -0
  31. package/src/assets/images/anims/service_list/directo.json +1 -1
  32. package/src/assets/images/anims/service_list/priority_stage.json +1 -1
  33. package/src/components/ServiceItem/RatingHover.tsx +51 -51
  34. package/src/components/ServiceItem/ServiceItemDesktop.tsx +241 -616
  35. package/src/components/ServiceItem/ServiceItemMobile.tsx +120 -501
  36. package/src/components/ServiceItem/mobileTypes.ts +3 -0
  37. package/src/components/ServiceItem/types.ts +7 -0
  38. package/src/ui/AmenitiesBlock.tsx +34 -15
  39. package/src/ui/BottomAmenities/BottomAmenities.tsx +110 -0
  40. package/src/ui/DateTimeSection/DateTimeSection.tsx +207 -0
  41. package/src/ui/DirectoBlock.tsx +31 -0
  42. package/src/ui/DurationBlock.tsx +2 -2
  43. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +115 -0
  44. package/src/ui/FlexibleBlock.tsx +3 -3
  45. package/src/ui/KuposButton/KuposButton.tsx +48 -0
  46. package/src/ui/PetBlock.tsx +2 -2
  47. package/src/ui/RatingBlock.tsx +16 -4
  48. package/src/ui/SeatSection/SeatSection.tsx +187 -0
  49. package/src/ui/TopAmenities/TopAmenities.tsx +116 -0
  50. package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +168 -0
  51. package/src/ui/mobileweb/DateTimeSectionMobile.tsx +192 -0
  52. package/src/ui/mobileweb/SeatSectionMobile.tsx +256 -0
  53. package/src/ui/mobileweb/TopAmenitieMobile.tsx +82 -0
@@ -3,6 +3,10 @@ import LottiePlayer from "../../assets/LottiePlayer";
3
3
  import DateService from "../../utils/DateService";
4
4
  import { MobileServiceItemProps } from "./mobileTypes";
5
5
  import commonService from "../../utils/CommonService";
6
+ import TopAmenitieMobile from "../../ui/mobileweb/TopAmenitieMobile";
7
+ import BottomAmenitiesMobile from "../../ui/mobileweb/BottomAmenitiesMobile";
8
+ import SeatSectionMobile from "../../ui/mobileweb/SeatSectionMobile";
9
+ import DateTimeSectionMobile from "../../ui/mobileweb/DateTimeSectionMobile";
6
10
 
7
11
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
8
12
 
@@ -39,6 +43,7 @@ function ServiceItemMobile({
39
43
  }: MobileServiceItemProps): React.ReactElement {
40
44
  const isPetSeat = (Object.keys(serviceItem?.pet_seat_info) || []).length > 0;
41
45
  let isSoldOut = serviceItem.available_seats <= 0;
46
+ const showPromo = Math.random() > 0.5;
42
47
 
43
48
  const labelId =
44
49
  typeof serviceItem.boarding_stages === "string"
@@ -61,194 +66,6 @@ function ServiceItemMobile({
61
66
  }
62
67
  };
63
68
 
64
- const seatTypes = () => {
65
- let seatTypes = serviceItem.seat_types
66
- ?.filter((item) => getFilteredSeats(item.label))
67
- ?.sort((a, b) => a.fare - b.fare) // Add this line to sort by fare
68
- ?.slice(0, 2)
69
- ?.map((type, i) =>
70
- exceptions.includes(type.label) ? null : (
71
- <div
72
- className={
73
- serviceItem.seat_types?.length > 2
74
- ? "w-[100%] flex flex-row justify-between "
75
- : "w-[100%] flex flex-row justify-between items-center"
76
- }
77
- key={i}
78
- >
79
- <span
80
- className="min-[420]:text-[13px] text-[12px] "
81
- style={{
82
- // marginLeft: "10px",
83
- color: isSoldOut ? "#bbb" : "#464647",
84
- }}
85
- >
86
- {type.label}
87
- </span>
88
- <span
89
- className={"min-[420]:text-[13px] text-[12px] bold-text"}
90
- style={{ color: isSoldOut ? "#bbb" : colors.seatPriceColor }}
91
- >
92
- {commonService.currency(type.fare, currencySign)}
93
- </span>
94
- </div>
95
- ),
96
- );
97
- return seatTypes;
98
- };
99
-
100
- const seatTypesWithRemoveDuplicateSeats = () => {
101
- const seatMap = new Map();
102
-
103
- serviceItem.seat_types
104
- ?.filter((item) => getFilteredSeats(item.label))
105
- ?.forEach((item) => {
106
- if (exceptions.includes(item.key as any)) return;
107
- const existing = seatMap.get(item.label);
108
- if (
109
- !existing ||
110
- parseFloat(item.fare as any) < parseFloat(existing.fare)
111
- ) {
112
- seatMap.set(item.label, item);
113
- }
114
- });
115
-
116
- const uniqueSeats = Array.from(seatMap.values())
117
- .sort((a, b) => a.fare - b.fare)
118
- .slice(0, 3);
119
- return uniqueSeats.map((type, i) => {
120
- return exceptions.includes(type.label) ? null : (
121
- <div
122
- className={
123
- serviceItem.seat_types?.length > 2
124
- ? "w-[100%] flex flex-row justify-between "
125
- : "w-[100%] flex flex-row justify-between items-center"
126
- }
127
- key={i}
128
- >
129
- <span
130
- className="min-[420]:text-[13px] text-[11px] "
131
- style={{
132
- // marginLeft: "10px",
133
- color: isSoldOut ? "#bbb" : "#464647",
134
- }}
135
- >
136
- {commonService.truncateSeatLabel(type.label)}
137
- </span>
138
- <span
139
- className={"min-[420]:text-[13px] text-[11px] bold-text"}
140
- style={{ color: isSoldOut ? "#bbb" : colors.seatPriceColor }}
141
- >
142
- {/* {serviceItem?.operator_service_name === "Pullman San Andrés" &&
143
- serviceItem?.available_seats <= 0
144
- ? null
145
- : commonService.currency(type.fare, currencySign)} */}
146
-
147
- {serviceItem?.available_seats <= 0 && !isPeru
148
- ? commonService.currency(0, currencySign)
149
- : commonService.currency(type.fare, currencySign)}
150
- </span>
151
- </div>
152
- );
153
- });
154
- };
155
-
156
- const getFilteredSeats = (item) => {
157
- return item;
158
- };
159
-
160
- const getAmenitiesImage = (name: string): string => {
161
- switch (name) {
162
- case "air_condtion.png": {
163
- return serviceItem?.icons?.airConditionIcon;
164
- }
165
- case "baggage.png": {
166
- return serviceItem?.icons?.baggageIcon;
167
- }
168
- case "charging_plug.png": {
169
- return serviceItem?.icons?.chargingIcon;
170
- }
171
- case "coffee.png": {
172
- return serviceItem?.icons?.coffeeIcon;
173
- }
174
- case "food_new_icon.png": {
175
- return serviceItem?.icons?.foodIcon;
176
- }
177
- case "gaming.png": {
178
- return serviceItem?.icons?.gamingIcon;
179
- }
180
- case "handicap.png": {
181
- return serviceItem?.icons?.handicapIcon;
182
- }
183
- case "mobile_ticket.png": {
184
- return serviceItem?.icons?.mobileTicketIcon;
185
- }
186
- case "movie.png": {
187
- return serviceItem?.icons?.movieIcon;
188
- }
189
- case "restrooms.png": {
190
- return serviceItem?.icons?.restroomsIcon;
191
- }
192
- case "snacks_new.png": {
193
- return serviceItem?.icons?.snackIcon;
194
- }
195
- case "wifi.png": {
196
- return serviceItem?.icons?.wifiIcon;
197
- }
198
- case "cortina_divisoria.png": {
199
- return serviceItem?.icons?.cortinaIcon;
200
- }
201
- case "frazada.png": {
202
- return serviceItem?.icons?.frazaIcon;
203
- }
204
- case "blanket.png": {
205
- return serviceItem?.icons?.blankketIcon;
206
- }
207
- case "cctv.png": {
208
- return serviceItem?.icons?.cctvIcon;
209
- }
210
- case "cup_holder.png": {
211
- return serviceItem?.icons?.cupHolderIcon;
212
- }
213
- case "emergency_contact.png": {
214
- return serviceItem?.icons?.emergencyContactIcon;
215
- }
216
- case "emergency_exit.png": {
217
- return serviceItem?.icons?.emergencyExitIcon;
218
- }
219
- case "fire_extinguisher.png": {
220
- return serviceItem?.icons?.fireExtinguisherIcon;
221
- }
222
- case "reading_light.png": {
223
- return serviceItem?.icons?.readingLIghtIcon;
224
- }
225
- case "seat_belt.png": {
226
- return serviceItem?.icons?.sercurityBeltIcon;
227
- }
228
- case "service_on_board.png": {
229
- return serviceItem?.icons?.serviceOnBoardIcon;
230
- }
231
- case "personal_tv.png": {
232
- return serviceItem?.icons?.personalTVIcon;
233
- }
234
- case "pet_admission.png": {
235
- return serviceItem?.icons?.petAdmissionIcon;
236
- }
237
- case "music.png": {
238
- return serviceItem?.icons?.musicIcon;
239
- }
240
- case "headset.png": {
241
- return serviceItem?.icons?.headPhoneIcon;
242
- }
243
- case "allows_cancellation.png": {
244
- return serviceItem?.icons?.allowCancellationIcon;
245
- }
246
- default: {
247
- return "";
248
- }
249
- }
250
- };
251
-
252
69
  const amenities = () => {
253
70
  const raw = serviceItem?.operator_details?.[3];
254
71
  const list = Array.isArray(raw)
@@ -261,8 +78,8 @@ function ServiceItemMobile({
261
78
  <img
262
79
  key={i}
263
80
  className="amenity"
264
- height={14}
265
- width={14}
81
+ height={12}
82
+ width={12}
266
83
  // src={getAmenitiesImage(amenitiesData?.[am]?.toLowerCase())}
267
84
  src={commonService.getAmenitiesImage(
268
85
  amenitiesData?.[am]?.toLowerCase(),
@@ -298,32 +115,6 @@ function ServiceItemMobile({
298
115
  isConexion = true;
299
116
  }
300
117
 
301
- const depTime = serviceItem.dep_time || "";
302
-
303
- // Extract hours and minutes and check for AM/PM
304
- const hasAM = depTime.includes("AM");
305
- const hasPM = depTime.includes("PM");
306
- const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
307
- const [hour, minute] = timePart.split(":").map(Number);
308
-
309
- // Convert to 24-hour format
310
- let cleanedDepTime;
311
- if (hasAM) {
312
- cleanedDepTime =
313
- hour === 12
314
- ? `00:${minute < 10 ? "0" + minute : minute}`
315
- : `${hour < 10 ? "0" + hour : hour}:${
316
- minute < 10 ? "0" + minute : minute
317
- }`;
318
- } else if (hasPM) {
319
- cleanedDepTime =
320
- hour === 12
321
- ? `${hour}:${minute < 10 ? "0" + minute : minute}`
322
- : `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
323
- } else {
324
- cleanedDepTime = timePart;
325
- }
326
-
327
118
  return (
328
119
  <div
329
120
  className={`relative ${
@@ -333,28 +124,42 @@ function ServiceItemMobile({
333
124
  isConexion ||
334
125
  serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
335
126
  showTopLabel
336
- ? "mt-[20px]"
127
+ ? "mt-[10px]"
337
128
  : "mt-[10px]"
338
129
  } `}
339
130
  style={{ backgroundColor: "#fff", zIndex: 1 }}
340
131
  >
132
+ <TopAmenitieMobile
133
+ showTopLabel={showTopLabel}
134
+ isSoldOut={isSoldOut}
135
+ seatPriceColor={colors.seatPriceColor}
136
+ bombAnim={serviceItem.icons.bombAnim}
137
+ priorityStageAnim={serviceItem.icons.priorityStageAnim}
138
+ />
341
139
  <div
342
- className={"border border-[#E6E6E6] rounded-[20px]"}
343
- style={{ backgroundColor: "#fff", zIndex: 1 }}
140
+ className={" rounded-[20px]"}
141
+ style={{
142
+ backgroundColor: "#fff",
143
+ zIndex: 1,
144
+ // borderRadius: showTopLabel ? "10px 0 10px 10px" : "10px",
145
+ borderRadius: "14px 0 14px 14px",
146
+ border: `1px solid ${colors.bottomStripColor}`,
147
+ }}
344
148
  >
345
149
  <div
346
- className={`p-[12px] ${
347
- serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
348
- showTopLabel ||
349
- serviceItem?.is_direct_trip ||
350
- serviceItem?.is_transpordo
351
- ? "mt-[10px]"
352
- : ""
353
- }`}
150
+ // className={` ${
151
+ // serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
152
+ // showTopLabel ||
153
+ // serviceItem?.is_direct_trip ||
154
+ // serviceItem?.is_transpordo
155
+ // ? "mt-[10px]"
156
+ // : ""
157
+ // }`}
158
+ style={{ padding: "12px 12px 8px 12px" }}
354
159
  >
355
160
  {/* Header with operator info and favorite */}
356
- <div className="flex justify-between mb-[8px]">
357
- <div className="flex items-center w-[50%] justify-between">
161
+ <div className="flex justify-between items-center mb-[10px]">
162
+ <div className="flex items-center justify-between">
358
163
  <div className="w-[120px] overflow-y-hidden">
359
164
  <img
360
165
  src={serviceItem.operator_details[0]}
@@ -369,21 +174,44 @@ function ServiceItemMobile({
369
174
  {serviceItem?.operator_details[2]}
370
175
  </div>
371
176
  ) : showRating ? (
372
- <div className="flex min-[420]:text-[13px] text-[12px] bold-text items-center">
373
- <img
374
- src={serviceItem.icons.rating}
375
- alt="origin"
376
- className={`w-[12px] h-[12px] mr-[4px] object-contain ${
377
- isSoldOut ? "grayscale" : ""
378
- }`}
379
- />
380
- <span style={{ lineHeight: "normal" }}>
381
- {getServiceStars(serviceItem)}
382
- </span>
177
+ <div className="flex min-[420]:text-[13px] text-[12px] items-center">
178
+ <div className="flex items-center">
179
+ <div className="flex items-center">
180
+ <img
181
+ src={serviceItem.icons.rating}
182
+ alt="origin"
183
+ className={`w-[12px] h-[12px] mr-[4px] object-contain ${
184
+ isSoldOut ? "grayscale" : ""
185
+ }`}
186
+ />
187
+ <span style={{ lineHeight: "normal" }}>
188
+ {getServiceStars(serviceItem)}
189
+ </span>
190
+ </div>
191
+
192
+ <div
193
+ className="flex items-center cursor-pointer "
194
+ style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
195
+ >
196
+ <span className="ml-[3px] min-[420]:text-[13px] text-[12px]">
197
+ {serviceItem.operator_details[2]}
198
+ </span>
199
+ </div>
200
+ </div>
383
201
  </div>
384
202
  ) : null}
385
203
  </div>
386
204
  {showLastSeats ? (
205
+ <div className="flex justify-end ">
206
+ {serviceItem?.available_seats < 10 &&
207
+ serviceItem?.available_seats > 0 && (
208
+ <div className="text-[10px] text-[#464647] text-center">
209
+ ¡ Últimos Asientos!
210
+ </div>
211
+ )}
212
+ </div>
213
+ ) : null}
214
+ {/* {showLastSeats ? (
387
215
  <div className="flex justify-end -mt-[5px] -mb-[5px] items-center pt-[5px] pb-[5px] text-center ">
388
216
  {serviceItem?.available_seats < 10 &&
389
217
  serviceItem?.available_seats > 0 && (
@@ -398,267 +226,58 @@ function ServiceItemMobile({
398
226
  </span>
399
227
  )}
400
228
  </div>
401
- ) : null}
402
- </div>
403
-
404
- <div
405
- className="flex justify-between gap-[5px] w-full"
406
- onClick={onBookButtonPress}
407
- >
408
- {/* DATE AND TIME */}
409
- <div
410
- className="min-h-[2.5rem] flex flex-col justify-between gap-[4px] w-[50%] "
411
- style={{ justifyContent: isCiva && "center" }}
412
- >
413
- <div
414
- className={`flex items-center min-[420]:text-[13px] text-[12px] justify-between ${
415
- isSoldOut ? "text-[#c0c0c0]" : ""
416
- }`}
417
- >
418
- <div className="flex items-center" style={{ flex: 1 }}>
419
- <div>
420
- {" "}
421
- {orignLabel ? (
422
- <div className="w-[60px]">{orignLabel}</div>
423
- ) : (
424
- <div className="w-[14px] h-auto mr-[5px]">
425
- <img
426
- src={serviceItem.icons?.origin}
427
- alt="origin"
428
- className={`w-[14px] h-auto mr-[5px] ${
429
- isSoldOut ? "grayscale" : ""
430
- }`}
431
- />
432
- </div>
433
- )}
434
- </div>
435
- <div
436
- className="flex items-center relative capitalize justify-between "
437
- style={{ flex: 1 }}
438
- >
439
- <span className="cursor-pointer black-text">
440
- {DateService.getServiceItemDate(serviceItem.travel_date)}
441
- </span>
442
- <div className="absolute left-[50%]">•</div>
443
- <div className="font-[900] relative black-text">
444
- {isLinatal ? (
445
- <div>
446
- <span>
447
- {" "}
448
- {cleanedDepTime}{" "}
449
- <span>{hasPM ? "PM" : hasAM ? "AM" : ""}</span>
450
- </span>
451
- <span>
452
- {serviceItem?.dep_time.includes("AM") ||
453
- serviceItem?.dep_time.includes("PM")
454
- ? null
455
- : DateService.ampmOnly(serviceItem.dep_time)}
456
- </span>
457
- </div>
458
- ) : (
459
- DateService.formatTime(serviceItem.dep_time)
460
- )}
461
- </div>
462
- </div>
463
- </div>
464
- </div>
465
- {isCiva ? null : (
466
- <div
467
- className={`flex items-center min-[420]:text-[13px] text-[12px] justify-between ${
468
- isSoldOut ? "text-[#c0c0c0]" : ""
469
- }`}
470
- >
471
- <div className="flex items-center" style={{ flex: 1 }}>
472
- <div>
473
- {" "}
474
- {destinationLabel ? (
475
- <div className="w-[60px]">{destinationLabel}</div>
476
- ) : (
477
- <div className="w-[14px] h-auto mr-[5px]">
478
- <img
479
- src={serviceItem.icons?.destination}
480
- alt="destination"
481
- className={`w-[14px] h-auto mr-[5px] ${
482
- isSoldOut ? "grayscale" : ""
483
- }`}
484
- />
485
- </div>
486
- )}
487
- </div>
488
- <div
489
- className="flex items-center relative capitalize justify-between "
490
- style={{ flex: 1 }}
491
- >
492
- <span className="cursor-pointer black-text">
493
- {DateService.getServiceItemDate(
494
- serviceItem.arrival_date,
495
- )}
496
- </span>
497
- <div className="absolute left-[50%]">•</div>
498
- <div className="font-[900] relative black-text">
499
- {DateService.formatTime(serviceItem.arr_time)}
500
- </div>
501
- </div>
502
- </div>
503
- </div>
504
- )}
505
- </div>
506
- <div
507
- style={{
508
- width: "1px",
509
- height: "2.5rem",
510
- backgroundColor: "#ccc",
511
- margin: "auto",
512
- }}
513
- ></div>
514
- {/* SEATS */}
515
- <div
516
- className="content-center"
517
- style={{
518
- width: isPeru ? "40%" : "40%",
519
- }}
520
- >
521
- <div
522
- className="flex flex-col justify-between h-[2.5rem] "
523
- style={{
524
- gap: isSoldOut ? "0px" : "5px",
525
- justifyContent:
526
- serviceItem.seat_types?.length > 2
527
- ? "space-between"
528
- : "center",
529
- }}
530
- >
531
- {removeDuplicateSeats
532
- ? seatTypesWithRemoveDuplicateSeats()
533
- : seatTypes()}
534
-
535
- {isSoldOut ? (
536
- <div className="flex justify-end">
537
- <span
538
- className={
539
- "min-[420]:text-[13px] text-[12px] text-[#ccc]"
540
- }
541
- >
542
- Agotado
543
- </span>
544
- </div>
545
- ) : null}
546
- </div>
547
- </div>
229
+ ) : null} */}
548
230
  </div>
549
- <div className="bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]"></div>
550
- <div
551
- className={`${"flex justify-between items-center items-center "}`}
552
- >
553
- {/* Rating */}
554
- <div>
555
- <div className="flex items-center ">
556
- <div
557
- className="flex items-center cursor-pointer "
558
- style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
559
- >
560
- <span className="ml-[3px] min-[420]:text-[13px] text-[12px] bold-text">
561
- {serviceItem.operator_details[2]}
562
- </span>
563
- </div>
564
- </div>
565
- </div>
566
-
567
- <div
568
- className="flex relative "
569
- style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
570
- >
571
- <div
572
- className={`w-[12px] h-auto mr-[2px] ${
573
- isSoldOut ? "grayscale" : ""
574
- }`}
575
- >
576
- {renderIcon("hours", "14px")}
577
- </div>
578
- &nbsp;
579
- <div
580
- className={`cursor-default group min-[420]:text-[13px] text-[12px] ${
581
- isSoldOut ? "text-[#c0c0c0]" : ""
582
- }`}
583
- style={{ lineHeight: "normal" }}
584
- >
585
- {serviceItem.duration}hrs
586
- </div>
587
- </div>
588
-
589
- <div style={{ opacity: isSoldOut ? 0.5 : 1 }}>{amenities()}</div>
590
231
 
591
- {(serviceItem.is_change_ticket || isPetSeat) && (
592
- <div
593
- onClick={() => {
594
- setShowDropdown(!showDropdown);
595
- setAmenetiesAtomValue({
596
- service: serviceItem,
597
- showTopLabel: showTopLabel,
598
- });
599
- }}
600
- className="flex items-center"
601
- >
602
- {serviceItem.pet_seat_info &&
603
- Object.keys(serviceItem.pet_seat_info).length > 0 ? (
604
- <div className="flex items-center">
605
- <div className={`relative group cursor-default `}>
606
- <div className="flex items-center">
607
- <div
608
- className={`mr-[5px] ${isSoldOut ? "grayscale" : ""}`}
609
- >
610
- <LottiePlayer
611
- animationData={serviceItem.icons.petFriendlyAnim}
612
- width="20px"
613
- height="20px"
614
- />
615
- </div>
616
- </div>
617
- </div>
618
- </div>
619
- ) : null}
620
-
621
- {/* Flexible ticket */}
622
- {serviceItem.is_change_ticket && (
623
- <div className="flex items-center">
624
- <div className="relative group cursor-default">
625
- <div className="flex items-center">
626
- <div
627
- className={`mr-[5px] ${isSoldOut ? "grayscale" : ""}`}
628
- >
629
- <LottiePlayer
630
- animationData={serviceItem.icons.flexibleAnim}
631
- width="20px"
632
- height="20px"
633
- />
634
- </div>
635
- </div>
636
- </div>
637
- </div>
638
- )}
639
-
640
- {serviceItem?.is_tracking_enabled && (
641
- <div className="flex items-center mr-[10px]">
642
- <div
643
- className={`h-auto mr-[4px] min-[420]:text-[13px] text-[11px] text-[#464647] ${
644
- isSoldOut ? "grayscale" : ""
645
- }`}
646
- >
647
- <LottiePlayer
648
- animationData={serviceItem.icons.locationAnim}
649
- width="20px"
650
- height="20px"
651
- />
652
- </div>
653
- </div>
654
- )}
655
-
656
- {(serviceItem.is_change_ticket || isPetSeat) && (
657
- <img src={serviceItem.icons.plus} alt="icon" width={11} />
658
- )}
659
- </div>
660
- )}
661
- </div>
232
+ <DateTimeSectionMobile
233
+ onBookButtonPress={onBookButtonPress}
234
+ isCiva={isCiva}
235
+ isSoldOut={isSoldOut}
236
+ isLinatal={isLinatal}
237
+ isPeru={isPeru}
238
+ orignLabel={orignLabel}
239
+ destinationLabel={destinationLabel}
240
+ originIcon={serviceItem.icons?.origin}
241
+ destinationIcon={serviceItem.icons?.destination}
242
+ travelDate={serviceItem.travel_date}
243
+ arrivalDate={serviceItem.arrival_date}
244
+ depTime={serviceItem.dep_time}
245
+ arrTime={serviceItem.arr_time}
246
+ seatTypes={serviceItem.seat_types}
247
+ seatPriceColor={colors.seatPriceColor}
248
+ currencySign={currencySign}
249
+ availableSeats={serviceItem.available_seats}
250
+ removeDuplicateSeats={removeDuplicateSeats}
251
+ />
252
+ {/* <div className="bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]"></div> */}
253
+ <div className="bg-[#E6E6E6] mt-[10px] mb-[10px] h-[1px]"></div>
254
+
255
+ <BottomAmenitiesMobile
256
+ isSoldOut={isSoldOut}
257
+ amenitiesNodes={amenities()}
258
+ hoursIcon={renderIcon("hours", "14px")}
259
+ duration={serviceItem.duration?.toString()}
260
+ isDirectTrip={serviceItem?.is_direct_trip}
261
+ directoColor={colors.directoColor}
262
+ directoAnim={serviceItem.icons.directoAnim}
263
+ isChangeTicket={serviceItem.is_change_ticket}
264
+ isPetSeat={isPetSeat}
265
+ petSeatInfo={serviceItem.pet_seat_info}
266
+ petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
267
+ flexibleAnim={serviceItem.icons.flexibleAnim}
268
+ isTrackingEnabled={serviceItem?.is_tracking_enabled}
269
+ locationAnim={serviceItem.icons.locationAnim}
270
+ downArrowIcon={serviceItem.icons.downArrow}
271
+ showDropdown={showDropdown}
272
+ setShowDropdown={setShowDropdown}
273
+ onDropdownToggle={() => {
274
+ setShowDropdown(!showDropdown);
275
+ setAmenetiesAtomValue({
276
+ service: serviceItem,
277
+ showTopLabel: showTopLabel,
278
+ });
279
+ }}
280
+ />
662
281
  </div>
663
282
 
664
283
  {serviceItem?.offer_text && (
@@ -684,7 +303,7 @@ function ServiceItemMobile({
684
303
  )}
685
304
 
686
305
  <div className="absolute -top-[14px] left-0 w-full flex items-center justify-end gap-[12px] pr-[20px] z-10 ">
687
- {showTopLabel && (
306
+ {/* {showTopLabel && (
688
307
  <div
689
308
  className={`flex items-center gap-[2px] py-[5px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `}
690
309
  style={{
@@ -752,7 +371,7 @@ function ServiceItemMobile({
752
371
  />
753
372
  <div>{"Tren Express"}</div>
754
373
  </div>
755
- )}
374
+ )} */}
756
375
  </div>
757
376
  </div>
758
377
  </div>