kui-crm_actions 0.0.55 → 0.0.57

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/cjs/index.js CHANGED
@@ -763,8 +763,8 @@ var useMetersValues = function (formStore, metersStore) {
763
763
  };
764
764
 
765
765
  var ApartmentInspectionPoint = function (props) {
766
- var date = props.date, onClick = props.onClick, isActive = props.isActive;
767
- return (jsxRuntime.jsx(kuiBasic.Button, __assign({ size: "xs", variant: isActive ? "primary" : "white", onClick: onClick }, { children: (date === null || date === void 0 ? void 0 : date.toFormat("dd.MM.yyyy")) || "-" })));
766
+ var date = props.date, onClick = props.onClick, isActive = props.isActive, apartment = props.apartment;
767
+ return (jsxRuntime.jsx(kuiBasic.Button, __assign({ size: "xs", variant: isActive ? "primary" : "white", onClick: onClick }, { children: (date === null || date === void 0 ? void 0 : date.toFormat("dd.MM.yyyy")) || "".concat(Number(apartment.roomsCount), "-\u043A\u043E\u043C\u043D.") })));
768
768
  };
769
769
 
770
770
  var MetroStation = function (props) {
@@ -788,10 +788,11 @@ var templateObject_1$2, templateObject_2$1;
788
788
 
789
789
  var ApartmentInspectionCard = function (props) {
790
790
  var inspection = props.inspection, onClose = props.onClose, getClientLink = props.getClientLink, getInspectionLink = props.getInspectionLink;
791
- var apartment = inspection.apartment, tenant = inspection.tenant, metroStations = inspection.metroStations;
792
- var clientLink = getClientLink && tenant ? getClientLink(tenant.id) : "";
791
+ var apartment = inspection.apartment, tenant = inspection.tenant, landlord = inspection.landlord, metroStations = inspection.metroStations;
792
+ var client = tenant || landlord;
793
+ var clientLink = getClientLink && client ? getClientLink(client === null || client === void 0 ? void 0 : client.id) : "";
793
794
  var apartmentLink = getInspectionLink(apartment.id, inspection.id);
794
- return (jsxRuntime.jsxs(StyledCard, { children: [jsxRuntime.jsx(kuiCrm.Link, __assign({ href: apartmentLink }, { children: jsxRuntime.jsx(StyledPreviewContent, { imageSrc: apartment.previewImage, description: apartment.address }) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ container: true, spacing: 2, alignItems: "center" }, { children: metroStations.map(function (station) { return (jsxRuntime.jsx(MetroStation, { metroStation: station }, station.name)); }) })), !!tenant && (jsxRuntime.jsxs(StyledTenantInfo, __assign({ container: true, alignItems: "center", justify: "space-between" }, { children: [clientLink ? (jsxRuntime.jsx(StyledClientLink, __assign({ href: clientLink }, { children: jsxRuntime.jsx(kuiCrm.UserBadge, { weight: 500, user: tenant }) }))) : (jsxRuntime.jsx(kuiCrm.UserBadge, { weight: 500, user: tenant })), !!tenant.phoneNumber && jsxRuntime.jsx(ContactPhone, { phone: tenant.phoneNumber })] }))), jsxRuntime.jsx(StyledCloseButton, __assign({ isCircle: true, size: "xs", variant: "whiteWithGray", onClick: onClose }, { children: jsxRuntime.jsx(kuiIcon.CloseIcon, { width: 6, height: 6 }) }))] }));
795
+ return (jsxRuntime.jsxs(StyledCard, { children: [jsxRuntime.jsx(kuiCrm.Link, __assign({ href: apartmentLink }, { children: jsxRuntime.jsx(StyledPreviewContent, { imageSrc: apartment.previewImage, description: apartment.address }) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ container: true, spacing: 2, alignItems: "center" }, { children: metroStations.map(function (station) { return (jsxRuntime.jsx(MetroStation, { metroStation: station }, station.name)); }) })), !!client && (jsxRuntime.jsxs(StyledTenantInfo, __assign({ container: true, alignItems: "center", justify: "space-between" }, { children: [clientLink ? (jsxRuntime.jsx(StyledClientLink, __assign({ href: clientLink }, { children: jsxRuntime.jsx(kuiCrm.UserBadge, { weight: 500, user: client }) }))) : (jsxRuntime.jsx(kuiCrm.UserBadge, { weight: 500, user: client })), !!(client === null || client === void 0 ? void 0 : client.phoneNumber) && (jsxRuntime.jsx(ContactPhone, { phone: client === null || client === void 0 ? void 0 : client.phoneNumber }))] }))), jsxRuntime.jsx(StyledCloseButton, __assign({ isCircle: true, size: "xs", variant: "whiteWithGray", onClick: onClose }, { children: jsxRuntime.jsx(kuiIcon.CloseIcon, { width: 6, height: 6 }) }))] }));
795
796
  };
796
797
  var StyledCard = styled__default["default"].div(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n width: 330px;\n background: ", ";\n border-radius: 8px;\n padding: 8px;\n position: absolute;\n bottom: 46px;\n left: -115px;\n z-index: 1;\n"], ["\n width: 330px;\n background: ", ";\n border-radius: 8px;\n padding: 8px;\n position: absolute;\n bottom: 46px;\n left: -115px;\n z-index: 1;\n"])), kuiBasic.theme.palette.grey.zero);
797
798
  var StyledPreviewContent = styled__default["default"](kuiCrm.PreviewContent)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: 8px;\n p {\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n }\n"], ["\n margin-bottom: 8px;\n p {\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n }\n"])));
@@ -803,7 +804,7 @@ var templateObject_1$1, templateObject_2, templateObject_3, templateObject_4, te
803
804
  var ApartmentInspectionOverlay = function (props) {
804
805
  var inspection = props.inspection, map = props.map, other = __rest(props, ["inspection", "map"]);
805
806
  var _a = kuiCrm.useMapCards(inspection.location, map), ref = _a.ref, isOpen = _a.isOpen, closeCard = _a.closeCard, toggleCard = _a.toggleCard;
806
- return (jsxRuntime.jsx(kuiCrm.MapOverlay, __assign({ map: map, position: inspection.location }, { children: jsxRuntime.jsxs(StyledWrapper, __assign({ ref: ref }, { children: [jsxRuntime.jsx(ApartmentInspectionPoint, { date: inspection.date, isActive: isOpen, onClick: toggleCard }), isOpen && (jsxRuntime.jsx(ApartmentInspectionCard, __assign({ inspection: inspection, onClose: closeCard }, other)))] })) })));
807
+ return (jsxRuntime.jsx(kuiCrm.MapOverlay, __assign({ map: map, position: inspection.location }, { children: jsxRuntime.jsxs(StyledWrapper, __assign({ ref: ref }, { children: [jsxRuntime.jsx(ApartmentInspectionPoint, { date: inspection.date, apartment: inspection.apartment, isActive: isOpen, onClick: toggleCard }), isOpen && (jsxRuntime.jsx(ApartmentInspectionCard, __assign({ inspection: inspection, onClose: closeCard }, other)))] })) })));
807
808
  };
808
809
  var StyledWrapper = styled__default["default"].div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
809
810
  var templateObject_1;