kupos-ui-components-lib 10.4.42 → 10.4.45

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.
@@ -297,6 +297,14 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
297
297
  Object.keys(serviceItem.pet_seat_info).length > 0,
298
298
  render: (React.createElement(PetBlock, { translation: translation, getAnimationIcon: getAnimationIcon, colors: colors, isSoldOut: isSoldOut })),
299
299
  },
300
+ {
301
+ key: "servicetype",
302
+ width: "20%",
303
+ condition: serviceItem.service_type,
304
+ render: (React.createElement("div", { className: "mt-[4px]" },
305
+ renderIcon("serviceTypeIcon", "12px"),
306
+ React.createElement("span", { className: "group text-[13.33px] cursor-pointer ml-[3px] " }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.service_type))),
307
+ },
300
308
  {
301
309
  key: "flexible",
302
310
  width: "20%",
@@ -304,7 +312,10 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
304
312
  render: (React.createElement(FlexibleBlock, { translation: translation, getAnimationIcon: getAnimationIcon, colors: colors, serviceItem: serviceItem, isSoldOut: isSoldOut })),
305
313
  },
306
314
  ];
307
- const otherItems = items.filter((i) => i.key !== "pet" && i.key !== "flexible" && !!i.condition);
315
+ const otherItems = items.filter((i) => i.key !== "pet" &&
316
+ i.key !== "flexible" &&
317
+ i.key !== "servicetype" &&
318
+ !!i.condition);
308
319
  return (React.createElement(React.Fragment, null, isPeruSites ? (React.createElement(PeruServiceItemDesktop, { serviceItem: serviceItem, onBookButtonPress: onBookButtonPress, colors: colors, metaData: metaData, children: children, busStage: busStage, serviceDetailsLoading: serviceDetailsLoading, cityOrigin: cityOrigin, cityDestination: cityDestination, translation: translation, orignLabel: orignLabel, destinationLabel: destinationLabel, currencySign: currencySign, isCiva: isCiva, showRating: showRating, showLastSeats: showLastSeats, removeArrivalTime: removeArrivalTime, removeDuplicateSeats: removeDuplicateSeats, isPeruSites: isPeruSites, t: (key) => t(key), showAvailableSeats: showAvailableSeats, isSeatIcon: isSeatIcon, isPeru: isPeru, siteType: siteType, isAllinBus: isAllinBus, viewersConfig: viewersConfig, isLoggedIn: isLoggedIn, showLoginModal: showLoginModal, isExpand: isExpand, setIsExpand: setIsExpand, coachKey: coachKey, isFlores: isFlores, isNewUiEnabled: isNewUiEnabledPeru, showLoginOption: showLoginOption, priority_stage_ids: priority_stage_ids })) : isNewUi && !isTrain ? (React.createElement(FeatureServiceUi, { serviceItem: serviceItem, showTopLabel: showTopLabel, getAnimationIcon: getAnimationIcon, cityOrigin: cityOrigin, cityDestination: cityDestination, renderIcon: renderIcon, viewersConfig: viewersConfig, isFeatureDropDownExpand: isFeatureDropDownExpand, ticketQuantity: ticketQuantity, onIncreaseTicketQuantity: onIncreaseTicketQuantity, onDecreaseTicketQuantity: onDecreaseTicketQuantity, onBookButtonPress: onRemateUiButtonClick, onToggleExpand: () => setIsFeatureDropDownExpand &&
309
320
  setIsFeatureDropDownExpand(isFeatureDropDownExpand === serviceItem.id ||
310
321
  isFeatureDropDownExpand === true
@@ -365,7 +376,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
365
376
  color: colors.seatPriceColor,
366
377
  } }, "\u00A1\u00DAltimos Asientos!")))) : null)),
367
378
  React.createElement(BottomAmenities, { otherItems: otherItems, serviceItem: serviceItem, grayscaleClass: grayscaleClass, isSoldOut: isSoldOut, isItemExpanded: isItemExpanded, colors: colors, translation: translation, getAnimationIcon: getAnimationIcon, downArrowIcon: renderIcon("downArrow", "10px"), onToggleExpand: () => setIsExpand &&
368
- setIsExpand(isItemExpanded ? null : serviceItem.id), isPeru: isPeru, isTrain: isTrain, isDpEnabled: serviceItem.is_dp_enabled }))),
379
+ setIsExpand(isItemExpanded ? null : serviceItem.id), isPeru: isPeru, isTrain: isTrain, isDpEnabled: serviceItem.is_dp_enabled, serviceType: serviceItem.service_type, renderIcon: renderIcon }))),
369
380
  isPeru ? null : (React.createElement("div", { style: {
370
381
  display: "grid",
371
382
  gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
@@ -161,9 +161,9 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
161
161
  color: colors.tooltipBgColor,
162
162
  } }, "\u00A1\u00DAltimos Asientos!")))) : null,
163
163
  React.createElement("div", { className: "bg-[#E6E6E6] mt-[10px] mb-[8px] h-[1px]" }),
164
- React.createElement(BottomAmenitiesMobile, { isSoldOut: isSoldOut, amenitiesNodes: amenities(), hoursIcon: renderIcon("hours", "14px"), duration: (_j = serviceItem.duration) === null || _j === void 0 ? void 0 : _j.toString(), isDirectTrip: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip, directoColor: colors.directoColor, directoAnim: serviceItem.icons.directoAnim, isChangeTicket: serviceItem.is_change_ticket, isPetSeat: isPetSeat, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, flexibleAnim: serviceItem.icons.flexibleAnim, isTrackingEnabled: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled, locationAnim: serviceItem.icons.locationAnim, downArrowIcon: serviceItem.icons.downArrow, showDropdown: isItemExpanded, setShowDropdown: () => setIsExpanded(isItemExpanded ? null : serviceItem.id), onDropdownToggle: () => {
164
+ React.createElement(BottomAmenitiesMobile, { isSoldOut: isSoldOut, amenitiesNodes: amenities(), hoursIcon: renderIcon("hours", "14px"), duration: (_j = serviceItem.duration) === null || _j === void 0 ? void 0 : _j.toString(), isDirectTrip: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip, serviceType: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.service_type, directoColor: colors.directoColor, directoAnim: serviceItem.icons.directoAnim, isChangeTicket: serviceItem.is_change_ticket, isPetSeat: isPetSeat, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, flexibleAnim: serviceItem.icons.flexibleAnim, isTrackingEnabled: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled, locationAnim: serviceItem.icons.locationAnim, downArrowIcon: serviceItem.icons.downArrow, showDropdown: isItemExpanded, setShowDropdown: () => setIsExpanded(isItemExpanded ? null : serviceItem.id), onDropdownToggle: () => {
165
165
  setIsExpanded(isItemExpanded ? null : serviceItem.id);
166
- }, isPeru: isPeru, femaleAnim: serviceItem.icons.femaleAnim, ladiesBookedSeats: serviceItem.ladies_booked_seats, isDpEnabled: serviceItem.is_dp_enabled, isTrain: isTrain })),
166
+ }, isPeru: isPeru, femaleAnim: serviceItem.icons.femaleAnim, ladiesBookedSeats: serviceItem.ladies_booked_seats, isDpEnabled: serviceItem.is_dp_enabled, isTrain: isTrain, renderIcon: renderIcon })),
167
167
  React.createElement(ServiceBadgesMobile, { showTopLabel: showTopLabel || undefined, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, serviceItem: serviceItem, isConexion: isConexion, isAllinBus: isAllinBus, boardingName: boardingName })),
168
168
  hasOfferText &&
169
169
  isNewUiEnabled &&
@@ -3,6 +3,7 @@ export interface MobileServiceItemProps {
3
3
  amenitiesData?: any;
4
4
  serviceItem: {
5
5
  id: string;
6
+ service_type?: string;
6
7
  is_transpordo?: boolean;
7
8
  operator_details: [
8
9
  string,
@@ -102,6 +103,7 @@ export interface MobileServiceItemProps {
102
103
  airConditionIcon?: string;
103
104
  baggageIcon?: string;
104
105
  chargingIcon?: string;
106
+ serviceTypeIcon?: string;
105
107
  coffeeIcon?: string;
106
108
  foodIcon?: string;
107
109
  gamingIcon?: string;
@@ -5,6 +5,7 @@ export interface ServiceItemProps {
5
5
  children?: React.ReactNode;
6
6
  serviceItem: {
7
7
  id: string;
8
+ service_type?: string;
8
9
  operator_details: [
9
10
  string,
10
11
  string | number,
package/dist/styles.css CHANGED
@@ -507,9 +507,6 @@
507
507
  .w-\[50\%\] {
508
508
  width: 50%;
509
509
  }
510
- .w-\[55\%\] {
511
- width: 55%;
512
- }
513
510
  .w-\[60\%\] {
514
511
  width: 60%;
515
512
  }
@@ -744,6 +741,9 @@
744
741
  .gap-\[2px\] {
745
742
  gap: 2px;
746
743
  }
744
+ .gap-\[3px\] {
745
+ gap: 3px;
746
+ }
747
747
  .gap-\[3rem\] {
748
748
  gap: 3rem;
749
749
  }
@@ -26,6 +26,8 @@ interface BottomAmenitiesProps {
26
26
  isPeru?: boolean;
27
27
  isTrain?: boolean;
28
28
  isDpEnabled?: boolean;
29
+ serviceType?: string;
30
+ renderIcon?: (iconKey: string, size?: string) => React.ReactNode;
29
31
  }
30
- declare function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, isItemExpanded, colors, translation, getAnimationIcon, downArrowIcon, onToggleExpand, isPeru, isTrain, isDpEnabled, }: BottomAmenitiesProps): React.ReactElement;
32
+ declare function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, isItemExpanded, colors, translation, getAnimationIcon, downArrowIcon, onToggleExpand, isPeru, isTrain, isDpEnabled, serviceType, renderIcon, }: BottomAmenitiesProps): React.ReactElement;
31
33
  export default BottomAmenities;
@@ -3,7 +3,8 @@ import LottiePlayer from "../../assets/LottiePlayer";
3
3
  import FlexibleBlock from "../FlexibleBlock";
4
4
  import PetBlock from "../PetBlock";
5
5
  import FemaleBlock from "../FemaleBlock";
6
- function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, isItemExpanded, colors, translation, getAnimationIcon, downArrowIcon, onToggleExpand, isPeru, isTrain, isDpEnabled, }) {
6
+ import CommonService from "../../utils/CommonService";
7
+ function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, isItemExpanded, colors, translation, getAnimationIcon, downArrowIcon, onToggleExpand, isPeru, isTrain, isDpEnabled, serviceType, renderIcon, }) {
7
8
  const hasPetInfo = serviceItem.pet_seat_info &&
8
9
  Object.keys(serviceItem.pet_seat_info).length > 0;
9
10
  const showDownArrow = ((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_change_ticket) && serviceItem.pet_seat_info) ||
@@ -11,11 +12,14 @@ function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, i
11
12
  Object.keys(serviceItem.pet_seat_info).length > 0);
12
13
  return (React.createElement("div", { className: "flex items-center mt-[15px] border-t border-[#eee] pt-[6px]" },
13
14
  React.createElement("div", { className: "grid items-center gap-[2%] flex-1 ", style: {
14
- // gridTemplateColumns: " 28% 21% 23% 23%",
15
15
  gridTemplateColumns: isTrain
16
16
  ? "25.6% 17% 23% 23%"
17
17
  : "25.3% 17% 23% 23%",
18
- } }, otherItems.map((item) => (React.createElement("div", { key: item.key, className: "flex items-center" }, item.render)))),
18
+ } },
19
+ otherItems.map((item) => (React.createElement("div", { key: item.key, className: "flex items-center" }, item.render))),
20
+ serviceType && (React.createElement("div", { className: `flex items-center gap-[3px] text-[13.33px] whitespace-nowrap ${isSoldOut ? "text-[#c0c0c0]" : "text-[#464647]"}`, style: { gridColumn: 4 } }, renderIcon === null || renderIcon === void 0 ? void 0 :
21
+ renderIcon("serviceTypeIcon", "15px"),
22
+ React.createElement("span", { className: "bold-text" }, CommonService.capitalizeFirstLetter(serviceType))))),
19
23
  React.createElement("div", { className: "flex items-center justify-end shrink-0 ml-[5px] w-[150px]" },
20
24
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: grayscaleClass + " mr-[10px]" },
21
25
  React.createElement(LottiePlayer, { animationData: getAnimationIcon("locationAnim"), width: "20px", height: "20px" }))),
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ declare const ServiceType: ({ serviceItem, translation, renderIcon, isSoldOut, colors, }: {
3
+ serviceItem: any;
4
+ translation: any;
5
+ renderIcon: any;
6
+ isSoldOut: any;
7
+ colors: any;
8
+ }) => React.JSX.Element;
9
+ export default ServiceType;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ const ServiceType = ({ serviceItem, translation, renderIcon, isSoldOut, colors, }) => (React.createElement("div", { className: "flex items-baseline relative whitespace-nowrap " },
3
+ React.createElement("div", { className: `w-[18px] mr-[4px] ${isSoldOut ? "grayscale" : ""}`, style: { opacity: isSoldOut ? 0.5 : 1 } }),
4
+ React.createElement("div", { className: "group text-[13.33px] cursor-pointer" },
5
+ React.createElement("span", { style: { opacity: isSoldOut ? 0.5 : 1 } }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.service_type),
6
+ React.createElement("div", { className: "hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-normal z-10 mt-2.5 w-[188px] text-center break-normal shadow-service text-[12px]", style: { backgroundColor: colors.bottomStripColor } },
7
+ React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: { borderBottomColor: colors.bottomStripColor } }),
8
+ "Duraci\u00F3n estimada del viaje"))));
9
+ export default ServiceType;
@@ -25,6 +25,9 @@ interface BottomAmenitiesMobileProps {
25
25
  isDpEnabled?: boolean;
26
26
  isTrain?: boolean;
27
27
  seatCategoryText?: string;
28
+ serviceType?: string;
29
+ serviceTypeIcon?: string;
30
+ renderIcon?: any;
28
31
  }
29
- declare function BottomAmenitiesMobile({ isSoldOut, amenitiesNodes, hoursIcon, duration, isDirectTrip, directoColor, directoAnim, isChangeTicket, isPetSeat, petSeatInfo, petFriendlyAnim, flexibleAnim, isTrackingEnabled, locationAnim, downArrowIcon, showDropdown, setShowDropdown, onDropdownToggle, isItemExpanded, isPeru, femaleAnim, ladiesBookedSeats, isDpEnabled, isTrain, seatCategoryText, }: BottomAmenitiesMobileProps): React.ReactElement;
32
+ declare function BottomAmenitiesMobile({ isSoldOut, amenitiesNodes, hoursIcon, duration, isDirectTrip, directoColor, directoAnim, isChangeTicket, isPetSeat, petSeatInfo, petFriendlyAnim, flexibleAnim, isTrackingEnabled, locationAnim, downArrowIcon, showDropdown, setShowDropdown, onDropdownToggle, isItemExpanded, isPeru, femaleAnim, ladiesBookedSeats, isDpEnabled, isTrain, seatCategoryText, serviceType, serviceTypeIcon, renderIcon, }: BottomAmenitiesMobileProps): React.ReactElement;
30
33
  export default BottomAmenitiesMobile;
@@ -1,16 +1,21 @@
1
1
  import React from "react";
2
2
  import LottiePlayer from "../../assets/LottiePlayer";
3
3
  import DateService from "../../utils/DateService";
4
- function BottomAmenitiesMobile({ isSoldOut, amenitiesNodes, hoursIcon, duration, isDirectTrip, directoColor, directoAnim, isChangeTicket, isPetSeat, petSeatInfo, petFriendlyAnim, flexibleAnim, isTrackingEnabled, locationAnim, downArrowIcon, showDropdown, setShowDropdown, onDropdownToggle, isItemExpanded, isPeru, femaleAnim, ladiesBookedSeats, isDpEnabled, isTrain, seatCategoryText, }) {
4
+ import commonService from "../../utils/CommonService";
5
+ function BottomAmenitiesMobile({ isSoldOut, amenitiesNodes, hoursIcon, duration, isDirectTrip, directoColor, directoAnim, isChangeTicket, isPetSeat, petSeatInfo, petFriendlyAnim, flexibleAnim, isTrackingEnabled, locationAnim, downArrowIcon, showDropdown, setShowDropdown, onDropdownToggle, isItemExpanded, isPeru, femaleAnim, ladiesBookedSeats, isDpEnabled, isTrain, seatCategoryText, serviceType, serviceTypeIcon, renderIcon, }) {
5
6
  return (React.createElement("div", { className: `${"flex justify-between items-center items-center "}` },
6
- React.createElement("div", { className: "w-[55%] flex justify-between items-center" },
7
+ React.createElement("div", { className: " flex justify-between items-center", style: { width: isPeru && serviceType ? "100%" : "55%" } },
7
8
  React.createElement("div", { style: { opacity: isSoldOut ? 0.5 : 1 } }, amenitiesNodes),
8
9
  React.createElement("div", { className: "flex relative ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
9
10
  React.createElement("div", { className: `w-[12px] h-auto mr-[2px] ${isSoldOut ? "grayscale" : ""}` }, hoursIcon),
10
11
  "\u00A0",
11
12
  React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } },
12
13
  DateService.formatDuration(duration),
13
- "hrs"))),
14
+ "hrs")),
15
+ serviceType && (React.createElement("div", { className: "flex relative ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
16
+ React.createElement("div", { className: `w-[12px] h-auto mr-[2px] ${isSoldOut ? "grayscale" : ""}` }, renderIcon("serviceTypeIcon", "12px")),
17
+ "\u00A0",
18
+ React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] bold-text ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } }, commonService.capitalizeFirstLetter(serviceType))))),
14
19
  seatCategoryText && (React.createElement("div", { className: "flex-1 text-right whitespace-nowrap min-[420]:text-[13px] text-[12px]", style: { opacity: isSoldOut ? 0.5 : 1 } }, seatCategoryText)),
15
20
  React.createElement("div", { className: "flex items-center" },
16
21
  React.createElement("div", null, (isChangeTicket || isPetSeat) && (React.createElement("div", { className: "flex items-center" },
@@ -45,7 +45,7 @@ const getUniqueSeats = (data, limit) => {
45
45
  });
46
46
  return Array.from(seatMap.values())
47
47
  .sort((a, b) => a.fare - b.fare)
48
- .slice(0, limit);
48
+ .slice(2, limit);
49
49
  };
50
50
  function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, }) {
51
51
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "10.4.42",
3
+ "version": "10.4.45",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -462,6 +462,20 @@ function ServiceItemPB({
462
462
  ),
463
463
  },
464
464
 
465
+ {
466
+ key: "servicetype",
467
+ width: "20%",
468
+ condition: serviceItem.service_type,
469
+ render: (
470
+ <div className="mt-[4px]">
471
+ {renderIcon("serviceTypeIcon", "12px")}
472
+ <span className="group text-[13.33px] cursor-pointer ml-[3px] ">
473
+ {serviceItem?.service_type}
474
+ </span>
475
+ </div>
476
+ ),
477
+ },
478
+
465
479
  {
466
480
  key: "flexible",
467
481
  width: "20%",
@@ -479,7 +493,11 @@ function ServiceItemPB({
479
493
  ];
480
494
 
481
495
  const otherItems = items.filter(
482
- (i) => i.key !== "pet" && i.key !== "flexible" && !!i.condition,
496
+ (i) =>
497
+ i.key !== "pet" &&
498
+ i.key !== "flexible" &&
499
+ i.key !== "servicetype" &&
500
+ !!i.condition,
483
501
  );
484
502
 
485
503
  return (
@@ -755,6 +773,8 @@ function ServiceItemPB({
755
773
  isPeru={isPeru}
756
774
  isTrain={isTrain}
757
775
  isDpEnabled={serviceItem.is_dp_enabled}
776
+ serviceType={serviceItem.service_type}
777
+ renderIcon={renderIcon}
758
778
  />
759
779
  </div>
760
780
  </div>
@@ -432,6 +432,7 @@ function ServiceItemMobile({
432
432
  hoursIcon={renderIcon("hours", "14px")}
433
433
  duration={serviceItem.duration?.toString()}
434
434
  isDirectTrip={serviceItem?.is_direct_trip}
435
+ serviceType={serviceItem?.service_type}
435
436
  directoColor={colors.directoColor}
436
437
  directoAnim={serviceItem.icons.directoAnim}
437
438
  isChangeTicket={serviceItem.is_change_ticket}
@@ -454,6 +455,7 @@ function ServiceItemMobile({
454
455
  ladiesBookedSeats={serviceItem.ladies_booked_seats}
455
456
  isDpEnabled={serviceItem.is_dp_enabled}
456
457
  isTrain={isTrain}
458
+ renderIcon={renderIcon}
457
459
  />
458
460
  </div>
459
461
 
@@ -6,6 +6,7 @@ export interface MobileServiceItemProps {
6
6
  amenitiesData?: any;
7
7
  serviceItem: {
8
8
  id: string;
9
+ service_type?: string;
9
10
  is_transpordo?: boolean;
10
11
  operator_details: [
11
12
  string,
@@ -105,6 +106,7 @@ export interface MobileServiceItemProps {
105
106
  airConditionIcon?: string;
106
107
  baggageIcon?: string;
107
108
  chargingIcon?: string;
109
+ serviceTypeIcon?: string;
108
110
  coffeeIcon?: string;
109
111
  foodIcon?: string;
110
112
  gamingIcon?: string;
@@ -7,6 +7,7 @@ export interface ServiceItemProps {
7
7
  children?: React.ReactNode;
8
8
  serviceItem: {
9
9
  id: string;
10
+ service_type?: string;
10
11
  operator_details: [
11
12
  string,
12
13
  string | number,
@@ -3,6 +3,7 @@ import LottiePlayer from "../../assets/LottiePlayer";
3
3
  import FlexibleBlock from "../FlexibleBlock";
4
4
  import PetBlock from "../PetBlock";
5
5
  import FemaleBlock from "../FemaleBlock";
6
+ import CommonService from "../../utils/CommonService";
6
7
 
7
8
  interface ItemEntry {
8
9
  key: string;
@@ -30,6 +31,8 @@ interface BottomAmenitiesProps {
30
31
  isPeru?: boolean;
31
32
  isTrain?: boolean;
32
33
  isDpEnabled?: boolean;
34
+ serviceType?: string;
35
+ renderIcon?: (iconKey: string, size?: string) => React.ReactNode;
33
36
  }
34
37
 
35
38
  function BottomAmenities({
@@ -46,6 +49,8 @@ function BottomAmenities({
46
49
  isPeru,
47
50
  isTrain,
48
51
  isDpEnabled,
52
+ serviceType,
53
+ renderIcon,
49
54
  }: BottomAmenitiesProps): React.ReactElement {
50
55
  const hasPetInfo =
51
56
  serviceItem.pet_seat_info &&
@@ -62,7 +67,6 @@ function BottomAmenities({
62
67
  <div
63
68
  className="grid items-center gap-[2%] flex-1 "
64
69
  style={{
65
- // gridTemplateColumns: " 28% 21% 23% 23%",
66
70
  gridTemplateColumns: isTrain
67
71
  ? "25.6% 17% 23% 23%"
68
72
  : "25.3% 17% 23% 23%",
@@ -73,6 +77,19 @@ function BottomAmenities({
73
77
  {item.render}
74
78
  </div>
75
79
  ))}
80
+ {serviceType && (
81
+ <div
82
+ className={`flex items-center gap-[3px] text-[13.33px] whitespace-nowrap ${
83
+ isSoldOut ? "text-[#c0c0c0]" : "text-[#464647]"
84
+ }`}
85
+ style={{ gridColumn: 4 }}
86
+ >
87
+ {renderIcon?.("serviceTypeIcon", "15px")}
88
+ <span className="bold-text">
89
+ {CommonService.capitalizeFirstLetter(serviceType)}
90
+ </span>
91
+ </div>
92
+ )}
76
93
  </div>
77
94
 
78
95
  {/* PET + FLEXIBLE (always visible) */}
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import LottiePlayer from "../../assets/LottiePlayer";
3
3
  import DateService from "../../utils/DateService";
4
+ import commonService from "../../utils/CommonService";
4
5
 
5
6
  interface BottomAmenitiesMobileProps {
6
7
  isSoldOut: boolean;
@@ -28,6 +29,9 @@ interface BottomAmenitiesMobileProps {
28
29
  isDpEnabled?: boolean;
29
30
  isTrain?: boolean;
30
31
  seatCategoryText?: string;
32
+ serviceType?: string;
33
+ serviceTypeIcon?: string;
34
+ renderIcon?: any;
31
35
  }
32
36
 
33
37
  function BottomAmenitiesMobile({
@@ -56,10 +60,16 @@ function BottomAmenitiesMobile({
56
60
  isDpEnabled,
57
61
  isTrain,
58
62
  seatCategoryText,
63
+ serviceType,
64
+ serviceTypeIcon,
65
+ renderIcon,
59
66
  }: BottomAmenitiesMobileProps): React.ReactElement {
60
67
  return (
61
68
  <div className={`${"flex justify-between items-center items-center "}`}>
62
- <div className="w-[55%] flex justify-between items-center">
69
+ <div
70
+ className=" flex justify-between items-center"
71
+ style={{ width: isPeru && serviceType ? "100%" : "55%" }}
72
+ >
63
73
  <div style={{ opacity: isSoldOut ? 0.5 : 1 }}>{amenitiesNodes}</div>
64
74
 
65
75
  <div
@@ -84,6 +94,30 @@ function BottomAmenitiesMobile({
84
94
  </div>
85
95
  </div>
86
96
 
97
+ {serviceType && (
98
+ <div
99
+ className="flex relative "
100
+ style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
101
+ >
102
+ <div
103
+ className={`w-[12px] h-auto mr-[2px] ${
104
+ isSoldOut ? "grayscale" : ""
105
+ }`}
106
+ >
107
+ {renderIcon("serviceTypeIcon", "12px")}
108
+ </div>
109
+ &nbsp;
110
+ <div
111
+ className={`cursor-default group min-[420]:text-[13px] text-[12px] bold-text ${
112
+ isSoldOut ? "text-[#c0c0c0]" : ""
113
+ }`}
114
+ style={{ lineHeight: "normal" }}
115
+ >
116
+ {commonService.capitalizeFirstLetter(serviceType)}
117
+ </div>
118
+ </div>
119
+ )}
120
+
87
121
  {/* {isDirectTrip && (
88
122
  <div
89
123
  className={`flex items-center gap-[2px] text-white min-[420]:text-[12px] text-[10px] z-20 `}
@@ -119,7 +119,7 @@ const getUniqueSeats = (data: SeatType[], limit: number): SeatType[] => {
119
119
 
120
120
  return Array.from(seatMap.values())
121
121
  .sort((a, b) => a.fare - b.fare)
122
- .slice(0, limit);
122
+ .slice(2, limit);
123
123
  };
124
124
 
125
125
  function SeatSectionMobile({
@@ -144,7 +144,10 @@ function SeatSectionMobile({
144
144
  serviceItem?.operator_service_name === "Movil Bus";
145
145
  const hasInclination = hasInclinationSeatTypes(seatTypesData ?? []);
146
146
  // Fetch ALL unique seats (no slice limit) for the multi-row seat-type case
147
- const allUniqueSeats = getUniqueSeats(seatTypesData ?? [], Infinity as number);
147
+ const allUniqueSeats = getUniqueSeats(
148
+ seatTypesData ?? [],
149
+ Infinity as number,
150
+ );
148
151
  // A service that exposes more than one seat type (e.g. "Bus Cama" + "160°")
149
152
  // lists every type with its own fare, under a shared "Desde" heading.
150
153
  const showSeatTypeRows =