contentoh-components-library 21.4.71 → 21.4.73
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/components/atoms/Avatar/index.js +2 -3
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/GeneralButton/styles.js +2 -6
- package/dist/components/atoms/InputFormatter/styles.js +3 -3
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/molecules/BoxAttribute/index.js +3 -3
- package/dist/components/molecules/BoxAttribute/styles.js +1 -1
- package/dist/components/molecules/BoxButtons/index.js +1 -0
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/SignInLogin/index.js +28 -36
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +2 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/Chat/styles.js +1 -1
- package/dist/components/organisms/DashboardMetric/index.js +6 -12
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/InputGroup/index.js +10 -1
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/organisms/VersionSelector/index.js +4 -2
- package/dist/components/pages/Dashboard/Dashboard.stories.js +36 -33
- package/dist/components/pages/Dashboard/index.js +9 -37
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +38 -34
- package/dist/components/pages/ProviderProductEdition/index.js +195 -182
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
- package/dist/components/pages/RetailerProductEdition/index.js +273 -278
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/global-files/data.js +3 -11
- package/dist/global-files/variables.js +1 -7
- package/dist/index.js +58 -201
- package/package.json +1 -2
- package/src/components/atoms/Avatar/index.js +2 -8
- package/src/components/atoms/CheckBox/styles.js +0 -2
- package/src/components/atoms/GeneralButton/styles.js +0 -46
- package/src/components/atoms/InputFormatter/styles.js +4 -9
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/atoms/TabSection/index.js +1 -1
- package/src/components/atoms/TabSection/styles.js +1 -1
- package/src/components/molecules/BoxAttribute/index.js +25 -32
- package/src/components/molecules/BoxAttribute/styles.js +1 -1
- package/src/components/molecules/BoxButtons/index.js +22 -23
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/SignInLogin/index.js +11 -11
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +2 -1
- package/src/components/molecules/TagAndInput/index.js +5 -6
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -14
- package/src/components/organisms/Chat/ContentChat/index.js +12 -88
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/Chat/styles.js +0 -4
- package/src/components/organisms/DashboardMetric/index.js +3 -6
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/InputGroup/index.js +119 -131
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
- package/src/components/organisms/VersionSelector/index.js +2 -1
- package/src/components/pages/Dashboard/Dashboard.stories.js +38 -33
- package/src/components/pages/Dashboard/index.js +7 -36
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +83 -110
- package/src/components/pages/ProviderProductEdition/index.js +152 -129
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +2 -6
- package/src/components/pages/RetailerProductEdition/index.js +136 -106
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/global-files/data.js +16 -8
- package/src/global-files/variables.js +0 -6
- package/src/index.js +0 -11
- package/src/assets/images/Icons/infoNR.svg +0 -8
- package/src/assets/images/flagsv2/highPriority.svg +0 -3
- package/src/assets/images/flagsv2/lowPriority.svg +0 -3
- package/src/assets/images/flagsv2/mediumPriority.svg +0 -3
- package/src/assets/images/flagsv2/noPriority.svg +0 -3
- package/src/assets/images/generalButton/closeIconWhite.svg +0 -4
- package/src/assets/images/generalButton/closeIconv2.svg +0 -4
- package/src/components/atoms/CharsMissing/Wysiwyg.stories.js +0 -12
- package/src/components/atoms/CharsMissing/index.js +0 -60
- package/src/components/atoms/CharsMissing/styles.js +0 -44
- package/src/components/atoms/FeatureTagv2/FeatureTagv2.stories.js +0 -16
- package/src/components/atoms/FeatureTagv2/index.js +0 -10
- package/src/components/atoms/FeatureTagv2/styles.js +0 -56
- package/src/components/atoms/GeneralInputv2/GeneralInputv2.stories.js +0 -33
- package/src/components/atoms/GeneralInputv2/index.js +0 -155
- package/src/components/atoms/GeneralInputv2/styles.js +0 -67
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
- package/src/components/atoms/ImageCarousel/index.js +0 -103
- package/src/components/atoms/ImageCarousel/styles.js +0 -79
- package/src/components/atoms/InputFormatterv2/Wysiwyg.stories.js +0 -12
- package/src/components/atoms/InputFormatterv2/index.js +0 -148
- package/src/components/atoms/InputFormatterv2/styles.js +0 -39
- package/src/components/atoms/InputImages/InputImages.stories.js +0 -19
- package/src/components/atoms/InputImages/index.js +0 -25
- package/src/components/atoms/InputImages/styles.js +0 -17
- package/src/components/atoms/NumberMandatory/NumberMandatory.stories.js +0 -19
- package/src/components/atoms/NumberMandatory/index.js +0 -16
- package/src/components/atoms/NumberMandatory/styles.js +0 -11
- package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
- package/src/components/atoms/PercentTag/index.js +0 -9
- package/src/components/atoms/PercentTag/styles.js +0 -69
- package/src/components/atoms/PriorityFlagv2/PriorityFlagv2.stories.js +0 -20
- package/src/components/atoms/PriorityFlagv2/index.js +0 -20
- package/src/components/atoms/PriorityFlagv2/styles.js +0 -6
- package/src/components/atoms/ProductImagev2/ProductImagev2.stories.js +0 -28
- package/src/components/atoms/ProductImagev2/index.js +0 -16
- package/src/components/atoms/ProductImagev2/styles.js +0 -62
- package/src/components/atoms/Progress/Progress.stories.js +0 -25
- package/src/components/atoms/Progress/index.js +0 -74
- package/src/components/atoms/Progress/styles.js +0 -98
- package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
- package/src/components/atoms/RatingStars/index.js +0 -31
- package/src/components/atoms/RatingStars/styles.js +0 -28
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
- package/src/components/atoms/RetailerCatalog/index.js +0 -49
- package/src/components/atoms/RetailerCatalog/styles.js +0 -30
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
- package/src/components/atoms/RetailerOption/index.js +0 -53
- package/src/components/atoms/RetailerOption/styles.js +0 -41
- package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
- package/src/components/atoms/RetailersList/index.js +0 -20
- package/src/components/atoms/RetailersList/styles.js +0 -19
- package/src/components/atoms/ScreenHeaderv2/ScreenHeaderv2.stories.js +0 -53
- package/src/components/atoms/ScreenHeaderv2/index.js +0 -134
- package/src/components/atoms/ScreenHeaderv2/styles.js +0 -103
- package/src/components/atoms/Selectv2/VersionSelect.js +0 -27
- package/src/components/atoms/Selectv2/index.js +0 -35
- package/src/components/atoms/Selectv2/style.js +0 -93
- package/src/components/atoms/TabSectionv2/TabSection.stories.js +0 -25
- package/src/components/atoms/TabSectionv2/index.js +0 -9
- package/src/components/atoms/TabSectionv2/styles.js +0 -20
- package/src/components/atoms/TooltipLight/Tooltip.stories.js +0 -20
- package/src/components/atoms/TooltipLight/index.js +0 -46
- package/src/components/atoms/TooltipLight/styles.js +0 -65
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
- package/src/components/atoms/UserCatalog/index.js +0 -100
- package/src/components/atoms/UserCatalog/styles.js +0 -24
- package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
- package/src/components/atoms/UserOption/index.js +0 -95
- package/src/components/atoms/UserOption/styles.js +0 -61
- package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
- package/src/components/atoms/UserSelector/index.js +0 -86
- package/src/components/atoms/UserSelector/styles.js +0 -55
- package/src/components/atoms/WordsMissing/Wysiwyg.stories.js +0 -12
- package/src/components/atoms/WordsMissing/index.js +0 -60
- package/src/components/atoms/WordsMissing/styles.js +0 -10
- package/src/components/molecules/AsignationInfo/AsignationInfo.stories.js +0 -17
- package/src/components/molecules/AsignationInfo/index.js +0 -108
- package/src/components/molecules/AsignationInfo/styles.js +0 -86
- package/src/components/molecules/EditionActiveImagev2/EditionActiveImagev2.stories.js +0 -12
- package/src/components/molecules/EditionActiveImagev2/index.js +0 -15
- package/src/components/molecules/EditionActiveImagev2/styles.js +0 -7
- package/src/components/molecules/FeaturesBarv2/FeaturesBarv2.stories.js +0 -20
- package/src/components/molecules/FeaturesBarv2/index.js +0 -32
- package/src/components/molecules/FeaturesBarv2/styles.js +0 -17
- package/src/components/molecules/GalleryElementv2/GalleryElementv2.stories.js +0 -30
- package/src/components/molecules/GalleryElementv2/index.js +0 -142
- package/src/components/molecules/GalleryElementv2/styles.js +0 -119
- package/src/components/molecules/GalleryHeaderv2/GalleryHeaderv2.stories.js +0 -10
- package/src/components/molecules/GalleryHeaderv2/index.js +0 -25
- package/src/components/molecules/GalleryHeaderv2/styles.js +0 -47
- package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
- package/src/components/molecules/GridItem/index.js +0 -105
- package/src/components/molecules/GridItem/styles.js +0 -104
- package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
- package/src/components/molecules/HeaderItem/index.js +0 -26
- package/src/components/molecules/HeaderItem/styles.js +0 -27
- package/src/components/molecules/HeaderTopv2/HeaderTopv2.stories.js +0 -10
- package/src/components/molecules/HeaderTopv2/index.js +0 -100
- package/src/components/molecules/HeaderTopv2/styles.js +0 -33
- package/src/components/molecules/ImageSelectorv2/ImageSelectorv2.stories.js +0 -46
- package/src/components/molecules/ImageSelectorv2/index.js +0 -22
- package/src/components/molecules/ImageSelectorv2/styles.js +0 -15
- package/src/components/molecules/Phase/Phase.stories.js +0 -37
- package/src/components/molecules/Phase/index.js +0 -56
- package/src/components/molecules/Phase/styles.js +0 -82
- package/src/components/molecules/ProductNameHeaderv2/ProductNameHeaderv2.stories.js +0 -37
- package/src/components/molecules/ProductNameHeaderv2/index.js +0 -12
- package/src/components/molecules/ProductNameHeaderv2/styles.js +0 -10
- package/src/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +0 -37
- package/src/components/molecules/ProductSkuStatus/index.js +0 -26
- package/src/components/molecules/ProductSkuStatus/styles.js +0 -7
- package/src/components/molecules/RetailerSelectorv2/RetailerSelectorv2.stories.js +0 -35
- package/src/components/molecules/RetailerSelectorv2/index.js +0 -80
- package/src/components/molecules/RetailerSelectorv2/styles.js +0 -21
- package/src/components/molecules/RowItem/ColumnItem.js +0 -9
- package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
- package/src/components/molecules/RowItem/index.js +0 -45
- package/src/components/molecules/RowItem/styles.js +0 -40
- package/src/components/molecules/ServiceDataValidator/ServiceDataValidator.stories.js +0 -90
- package/src/components/molecules/ServiceDataValidator/index.js +0 -49
- package/src/components/molecules/ServiceDataValidator/styles.js +0 -36
- package/src/components/molecules/StatusRetailer/StatusAsignationInfo.stories.js +0 -17
- package/src/components/molecules/StatusRetailer/index.js +0 -55
- package/src/components/molecules/StatusRetailer/styles.js +0 -85
- package/src/components/molecules/TabsMenuv2/TabsMenuv2.stories.js +0 -19
- package/src/components/molecules/TabsMenuv2/index.js +0 -112
- package/src/components/molecules/TabsMenuv2/styles.js +0 -19
- package/src/components/molecules/TagAndInputv2/TagAndInputv2.stories.js +0 -24
- package/src/components/molecules/TagAndInputv2/index.js +0 -86
- package/src/components/molecules/TagAndInputv2/styles.js +0 -35
- package/src/components/molecules/Validation/Validation.stories.js +0 -12
- package/src/components/molecules/Validation/index.js +0 -77
- package/src/components/molecules/Validation/styles.js +0 -19
- package/src/components/molecules/VersionItemv2/VersionItemv2.stories.js +0 -14
- package/src/components/molecules/VersionItemv2/index.js +0 -59
- package/src/components/molecules/VersionItemv2/styles.js +0 -47
- package/src/components/organisms/BarButtons/BarButtons.stories.js +0 -13
- package/src/components/organisms/BarButtons/index.js +0 -150
- package/src/components/organisms/BarButtons/styles.js +0 -54
- package/src/components/organisms/Chatv2/ChatLists/ChatLists.stories.js +0 -65
- package/src/components/organisms/Chatv2/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chatv2/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chatv2/ChatLists/index.js +0 -141
- package/src/components/organisms/Chatv2/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chatv2/Chatv2.stories.js +0 -184
- package/src/components/organisms/Chatv2/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chatv2/ContainerItems/index.js +0 -538
- package/src/components/organisms/Chatv2/ContainerItems/styles.js +0 -360
- package/src/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +0 -102
- package/src/components/organisms/Chatv2/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chatv2/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chatv2/ContentChat/index.js +0 -1016
- package/src/components/organisms/Chatv2/ContentChat/styles.js +0 -44
- package/src/components/organisms/Chatv2/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chatv2/Footer/index.js +0 -668
- package/src/components/organisms/Chatv2/Footer/styles.js +0 -290
- package/src/components/organisms/Chatv2/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chatv2/Header/index.js +0 -93
- package/src/components/organisms/Chatv2/Header/styles.js +0 -49
- package/src/components/organisms/Chatv2/index.js +0 -281
- package/src/components/organisms/Chatv2/styles.js +0 -85
- package/src/components/organisms/CompleteServices/CompleteServices.stories.js +0 -91
- package/src/components/organisms/CompleteServices/index.js +0 -82
- package/src/components/organisms/CompleteServices/styles.js +0 -35
- package/src/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +0 -12
- package/src/components/organisms/DragAndDropPhases/index.js +0 -67
- package/src/components/organisms/DragAndDropPhases/styles.js +0 -20
- package/src/components/organisms/DragPrueba/DragPrueba.stories.js +0 -12
- package/src/components/organisms/DragPrueba/index.js +0 -57
- package/src/components/organisms/DragPrueba/styles.js +0 -8
- package/src/components/organisms/FullProductNamev2/FullProductNamev2.stories.js +0 -28
- package/src/components/organisms/FullProductNamev2/index.js +0 -101
- package/src/components/organisms/FullProductNamev2/styles.js +0 -49
- package/src/components/organisms/FullTabsMenuv2/FullTabsMenuv2.stories.js +0 -22
- package/src/components/organisms/FullTabsMenuv2/index.js +0 -142
- package/src/components/organisms/FullTabsMenuv2/styles.js +0 -47
- package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
- package/src/components/organisms/GridProducts/index.js +0 -50
- package/src/components/organisms/GridProducts/styles.js +0 -14
- package/src/components/organisms/GridProducts/utils.js +0 -111
- package/src/components/organisms/ImageDataTablev2/ImageDataTablev2.stories.js +0 -24
- package/src/components/organisms/ImageDataTablev2/index.js +0 -124
- package/src/components/organisms/ImageDataTablev2/styles.js +0 -18
- package/src/components/organisms/ImagePreviewerv2/ImagePreviewerv2.stories.js +0 -38
- package/src/components/organisms/ImagePreviewerv2/index.js +0 -22
- package/src/components/organisms/ImagePreviewerv2/styles.js +0 -7
- package/src/components/organisms/InputGroupv2/InputGroupv2.stories.js +0 -31
- package/src/components/organisms/InputGroupv2/index.js +0 -296
- package/src/components/organisms/InputGroupv2/styles.js +0 -90
- package/src/components/organisms/MandatoryBar/MandatoryBar.stories.js +0 -18
- package/src/components/organisms/MandatoryBar/index.js +0 -31
- package/src/components/organisms/MandatoryBar/styles.js +0 -12
- package/src/components/organisms/ProductImageModalv2/ProductImageModalv2.stories.js +0 -90
- package/src/components/organisms/ProductImageModalv2/index.js +0 -105
- package/src/components/organisms/ProductImageModalv2/styles.js +0 -71
- package/src/components/organisms/RenameImagesBar/RenameImagesBar.stories.js +0 -18
- package/src/components/organisms/RenameImagesBar/index.js +0 -30
- package/src/components/organisms/RenameImagesBar/styles.js +0 -12
- package/src/components/organisms/VersionSelectorv2/VersionSelectorv2.stories.js +0 -15
- package/src/components/organisms/VersionSelectorv2/index.js +0 -105
- package/src/components/organisms/VersionSelectorv2/styles.js +0 -45
- package/src/components/pages/ProductEditionv2/ProductEditionv2.stories.js +0 -213
- package/src/components/pages/ProductEditionv2/index.js +0 -1758
- package/src/components/pages/ProductEditionv2/styles.js +0 -154
|
@@ -1,668 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Container,
|
|
3
|
-
ContainerItemCarrousel,
|
|
4
|
-
ContainerMain,
|
|
5
|
-
ContainerSecondary,
|
|
6
|
-
} from "./styles";
|
|
7
|
-
import { useEffect, useState, useRef } from "react";
|
|
8
|
-
import AWS from "aws-sdk";
|
|
9
|
-
import { v4 as uuidv4 } from "uuid";
|
|
10
|
-
import { Image as CustomImage } from "../../../atoms/Image";
|
|
11
|
-
import {
|
|
12
|
-
faArrowUp as IconSend,
|
|
13
|
-
faImage as IconImage,
|
|
14
|
-
faTrash as IconDelete,
|
|
15
|
-
faExclamationTriangle as IconWarning,
|
|
16
|
-
} from "@fortawesome/free-solid-svg-icons";
|
|
17
|
-
import { CustomIcon } from "../../../atoms/CustomIcon";
|
|
18
|
-
import { ButtonV2 } from "../../../atoms/ButtonV2";
|
|
19
|
-
import { IconFile } from "../../../atoms/IconFile";
|
|
20
|
-
import { Modal } from "../../Modal";
|
|
21
|
-
import { Tooltip } from "../../../atoms/Tooltip";
|
|
22
|
-
import { Fade, Tooltip as TooltipMUI } from "@mui/material";
|
|
23
|
-
import { ButtonFileChooser } from "../../../atoms/ButtonFileChooser";
|
|
24
|
-
import { Slide } from "@mui/material";
|
|
25
|
-
// carrousel
|
|
26
|
-
import { Swiper, SwiperSlide } from "swiper/react";
|
|
27
|
-
import "swiper/swiper.min.css";
|
|
28
|
-
//import "swiper/modules/free-mode/free-mode.min.css";
|
|
29
|
-
import { FreeMode, Mousewheel, Keyboard } from "swiper";
|
|
30
|
-
import {
|
|
31
|
-
getBase64,
|
|
32
|
-
getDataBase64,
|
|
33
|
-
getDataBuffer,
|
|
34
|
-
getFileExtension,
|
|
35
|
-
getFileName,
|
|
36
|
-
getImageSize,
|
|
37
|
-
isStringEmpty,
|
|
38
|
-
isValidNaturalNumber,
|
|
39
|
-
} from "../../../../global-files/utils";
|
|
40
|
-
import { InputText } from "../../../atoms/InputText";
|
|
41
|
-
|
|
42
|
-
const S3_BUCKET = process.env.REACT_APP_IMAGES_BUCKET;
|
|
43
|
-
const REGION = "us-east-1";
|
|
44
|
-
|
|
45
|
-
AWS.config.update({
|
|
46
|
-
accessKeyId: process.env.REACT_APP_KUTS3,
|
|
47
|
-
secretAccessKey: process.env.REACT_APP_AKUTS3,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const myBucket = new AWS.S3({
|
|
51
|
-
params: { Bucket: S3_BUCKET },
|
|
52
|
-
region: REGION,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
export const Footer = (props) => {
|
|
56
|
-
const {
|
|
57
|
-
chatType, // "merchant_product" | "order_product" | "ticket"
|
|
58
|
-
dataChat /* {
|
|
59
|
-
caso ticket: { id }
|
|
60
|
-
case merchant_product: { id , version }
|
|
61
|
-
case order_product: { id , version }
|
|
62
|
-
} */,
|
|
63
|
-
statusChat, // string
|
|
64
|
-
messageDisabled, // string
|
|
65
|
-
createItemsChat, // (items) => {}
|
|
66
|
-
errorUpdate, // { startDate , lastDate }
|
|
67
|
-
} = props;
|
|
68
|
-
const [valueInputMessage, setValueInputMessage] = useState("");
|
|
69
|
-
const [filesPreview, setFilesPreview] = useState([]);
|
|
70
|
-
const [filesJsxPreview, setFilesJsxPreview] = useState([]);
|
|
71
|
-
const [btnSendFilesLoading, setBtnSendFilesLoading] = useState(false);
|
|
72
|
-
const [btnSendMessageLoading, setBtnSendMessageLoading] = useState(false);
|
|
73
|
-
const [btnChooserFileDisabled, setBtnChooserFileDisabled] = useState(false);
|
|
74
|
-
const [inputMessageDisabled, setInputMessageDisabled] = useState(false);
|
|
75
|
-
const [openPreview, setOpenPreview] = useState(false);
|
|
76
|
-
const [toggleFocusInputMessage, setToggleFocusInputMessage] = useState(false);
|
|
77
|
-
const [tooltipFileName, setTooltipFileName] = useState({
|
|
78
|
-
show: false,
|
|
79
|
-
fileName: "",
|
|
80
|
-
});
|
|
81
|
-
const [modalAlert, setModalAlert] = useState({
|
|
82
|
-
show: false,
|
|
83
|
-
title: "",
|
|
84
|
-
message: "",
|
|
85
|
-
errorInputMessage: false,
|
|
86
|
-
});
|
|
87
|
-
const containerRef = useRef();
|
|
88
|
-
const refInputTextMessage = useRef();
|
|
89
|
-
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
setTooltipFileName({
|
|
92
|
-
show: false,
|
|
93
|
-
fileName: "",
|
|
94
|
-
});
|
|
95
|
-
renderFilesPreview();
|
|
96
|
-
}, [filesPreview]);
|
|
97
|
-
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
if (filesJsxPreview.length) setOpenPreview(true);
|
|
100
|
-
else setOpenPreview(false);
|
|
101
|
-
}, [filesJsxPreview]);
|
|
102
|
-
|
|
103
|
-
useEffect(() => {
|
|
104
|
-
refInputTextMessage.current && refInputTextMessage.current.focus();
|
|
105
|
-
}, [toggleFocusInputMessage]);
|
|
106
|
-
|
|
107
|
-
const sendFilesPreview = async () => {
|
|
108
|
-
if (createItemsChat) {
|
|
109
|
-
const files = filesPreview.slice();
|
|
110
|
-
if (!files.length) {
|
|
111
|
-
setModalAlert({
|
|
112
|
-
show: true,
|
|
113
|
-
title: "No hay ningun archivo o imagen seleccionado para enviar",
|
|
114
|
-
message:
|
|
115
|
-
"Por favor, cargue los archivos o imagenes que quiera enviar al chat",
|
|
116
|
-
errorInputMessage: false,
|
|
117
|
-
});
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
disableSecondaryContainer(true);
|
|
121
|
-
|
|
122
|
-
// subir archivos a AWS
|
|
123
|
-
const customFiles = [];
|
|
124
|
-
try {
|
|
125
|
-
const fileUploadRequests = [];
|
|
126
|
-
for (const file of files) {
|
|
127
|
-
let errorMessage;
|
|
128
|
-
// obtener base64
|
|
129
|
-
const fullBase64 = await getBase64(file);
|
|
130
|
-
if (!fullBase64) {
|
|
131
|
-
errorMessage = "No se pudo decodificar el archivo o imagen";
|
|
132
|
-
}
|
|
133
|
-
// obtener buffer
|
|
134
|
-
let dataBuffer;
|
|
135
|
-
if (!errorMessage)
|
|
136
|
-
dataBuffer = getDataBuffer(getDataBase64(fullBase64));
|
|
137
|
-
if (!dataBuffer) {
|
|
138
|
-
errorMessage = "No se pudo decodificar el archivo o imagen";
|
|
139
|
-
}
|
|
140
|
-
// obtener la key
|
|
141
|
-
let fileKey = "chat/";
|
|
142
|
-
switch (chatType) {
|
|
143
|
-
case "merchant_product":
|
|
144
|
-
if (
|
|
145
|
-
isValidNaturalNumber(dataChat?.id) &&
|
|
146
|
-
isValidNaturalNumber(dataChat?.version)
|
|
147
|
-
) {
|
|
148
|
-
fileKey += `merchantArticle/${dataChat.id}-${dataChat.version}/`;
|
|
149
|
-
} else {
|
|
150
|
-
errorMessage = "El ID o la version del producto no es valido";
|
|
151
|
-
}
|
|
152
|
-
break;
|
|
153
|
-
|
|
154
|
-
case "order_product":
|
|
155
|
-
if (
|
|
156
|
-
isValidNaturalNumber(dataChat?.id) &&
|
|
157
|
-
isValidNaturalNumber(dataChat?.version)
|
|
158
|
-
) {
|
|
159
|
-
fileKey += `orderArticle/${dataChat.id}-${dataChat.version}/`;
|
|
160
|
-
} else {
|
|
161
|
-
errorMessage = "El ID o la version del producto no es valido";
|
|
162
|
-
}
|
|
163
|
-
break;
|
|
164
|
-
|
|
165
|
-
case "ticket":
|
|
166
|
-
if (isValidNaturalNumber(dataChat?.id)) {
|
|
167
|
-
fileKey += `ticket/${dataChat.id}/`;
|
|
168
|
-
} else {
|
|
169
|
-
errorMessage = "El ID del ticket no es valido";
|
|
170
|
-
}
|
|
171
|
-
break;
|
|
172
|
-
case "product_status":
|
|
173
|
-
if (
|
|
174
|
-
isValidNaturalNumber(dataChat?.id) &&
|
|
175
|
-
isValidNaturalNumber(dataChat?.version) &&
|
|
176
|
-
isValidNaturalNumber(dataChat?.retailerId)
|
|
177
|
-
) {
|
|
178
|
-
fileKey += `productStatus/${dataChat.id}-${dataChat?.version}-${dataChat?.retailerId}/`;
|
|
179
|
-
} else {
|
|
180
|
-
errorMessage = "El ID del ticket no es valido";
|
|
181
|
-
}
|
|
182
|
-
break;
|
|
183
|
-
|
|
184
|
-
default:
|
|
185
|
-
errorMessage =
|
|
186
|
-
"El tipo de chat no se especifico de manera correcta";
|
|
187
|
-
}
|
|
188
|
-
if (!errorMessage) {
|
|
189
|
-
const today = new Date();
|
|
190
|
-
fileKey += `${uuidv4()}-${today.getTime()}.${getFileExtension(
|
|
191
|
-
file.name
|
|
192
|
-
)}`;
|
|
193
|
-
} else {
|
|
194
|
-
fileKey = undefined;
|
|
195
|
-
}
|
|
196
|
-
// enviar file a AWS
|
|
197
|
-
customFiles.push({
|
|
198
|
-
itemType: file.type.split("/")[0] === "image" ? "img" : "file",
|
|
199
|
-
key: fileKey,
|
|
200
|
-
errorOwn: errorMessage,
|
|
201
|
-
});
|
|
202
|
-
const paramsCreate = {
|
|
203
|
-
ACL: "public-read",
|
|
204
|
-
Body: dataBuffer,
|
|
205
|
-
Bucket: S3_BUCKET,
|
|
206
|
-
Key: fileKey,
|
|
207
|
-
};
|
|
208
|
-
fileUploadRequests.push(myBucket.putObject(paramsCreate).promise());
|
|
209
|
-
}
|
|
210
|
-
const responseAWS = await Promise.allSettled(fileUploadRequests);
|
|
211
|
-
responseAWS.forEach((responseFile, index) => {
|
|
212
|
-
if (responseFile.status === "rejected") {
|
|
213
|
-
customFiles[index].errorAWS = responseFile.reason.message;
|
|
214
|
-
customFiles[index].uploaded = false;
|
|
215
|
-
} else {
|
|
216
|
-
customFiles[index].uploaded = true;
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
} catch (err) {
|
|
220
|
-
console.log(err);
|
|
221
|
-
disableSecondaryContainer(false);
|
|
222
|
-
setModalAlert({
|
|
223
|
-
show: true,
|
|
224
|
-
title: "hubo un problema al subir los archivos al chat",
|
|
225
|
-
message: `${err.message}
|
|
226
|
-
Reporta esto a TI`,
|
|
227
|
-
errorInputMessage: false,
|
|
228
|
-
});
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// obtener las keys de los files subidos
|
|
233
|
-
const items = [];
|
|
234
|
-
for (let index = 0; index < customFiles.length; index++) {
|
|
235
|
-
const file = customFiles[index];
|
|
236
|
-
if (file.uploaded) {
|
|
237
|
-
const valueItem = {
|
|
238
|
-
key: file.key,
|
|
239
|
-
name: files[index].name,
|
|
240
|
-
};
|
|
241
|
-
// caso imagen -> obtener width y height
|
|
242
|
-
if (file.itemType === "img") {
|
|
243
|
-
const imgSize = await getImageSize(files[index]);
|
|
244
|
-
if (imgSize) {
|
|
245
|
-
valueItem.width = imgSize.width;
|
|
246
|
-
valueItem.height = imgSize.height;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
items.push({ type: file.itemType, value: JSON.stringify(valueItem) });
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// enviar los archivos subidos en AWS a la BD
|
|
254
|
-
if (items.length) {
|
|
255
|
-
const responseError = await createItemsChat(items);
|
|
256
|
-
// cuando ningun archivo se guardo en la BD
|
|
257
|
-
if (responseError) {
|
|
258
|
-
setModalAlert({
|
|
259
|
-
show: true,
|
|
260
|
-
title: responseError.message,
|
|
261
|
-
message: responseError.errorDetail,
|
|
262
|
-
errorInputMessage: false,
|
|
263
|
-
});
|
|
264
|
-
disableSecondaryContainer(false);
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// obtener los errores de los files no subidos a AWS
|
|
270
|
-
const failedFiles = [];
|
|
271
|
-
let errorDetailFiles = "";
|
|
272
|
-
customFiles.forEach((file, index) => {
|
|
273
|
-
if (!file.uploaded) {
|
|
274
|
-
if (failedFiles.length === 0) {
|
|
275
|
-
errorDetailFiles = `${files[index].name}:
|
|
276
|
-
Error: ${file.errorOwn ? file.errorOwn : file.errorAWS}`;
|
|
277
|
-
} else {
|
|
278
|
-
errorDetailFiles += `${"\n\n"}${files[index].name}:
|
|
279
|
-
Error: ${file.errorOwn ? file.errorOwn : file.errorAWS}`;
|
|
280
|
-
}
|
|
281
|
-
failedFiles.push(files[index]);
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
if (failedFiles.length) {
|
|
285
|
-
setModalAlert({
|
|
286
|
-
show: true,
|
|
287
|
-
title: `${failedFiles.length}/${files.length} archivos no fueron enviados al chat`,
|
|
288
|
-
message: errorDetailFiles,
|
|
289
|
-
errorInputMessage: false,
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
// actualizar filesPreview
|
|
293
|
-
disableSecondaryContainer(false);
|
|
294
|
-
setFilesPreview(failedFiles);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/*
|
|
298
|
-
if (file.type.split("/")[0] === "image") {
|
|
299
|
-
if (arrayIMG.data.ext[0] === "svg") {
|
|
300
|
-
handlerCreateItem("file", params.Key);
|
|
301
|
-
} else handlerCreateItem("img", params.Key);
|
|
302
|
-
} else if (
|
|
303
|
-
file.type.split("/")[0] === "application" ||
|
|
304
|
-
file.type.split("/")[0] === "text"
|
|
305
|
-
) {
|
|
306
|
-
handlerCreateItem("file", params.Key);
|
|
307
|
-
}
|
|
308
|
-
*/
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
const sendMessage = async () => {
|
|
312
|
-
if (createItemsChat) {
|
|
313
|
-
if (isStringEmpty(valueInputMessage)) {
|
|
314
|
-
setValueInputMessage("");
|
|
315
|
-
setModalAlert({
|
|
316
|
-
show: true,
|
|
317
|
-
title: "mensaje vacío",
|
|
318
|
-
message:
|
|
319
|
-
"Por favor, especifica el mensaje que quieres enviar al chat",
|
|
320
|
-
errorInputMessage: true,
|
|
321
|
-
});
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
setBtnSendMessageLoading(true);
|
|
325
|
-
setBtnChooserFileDisabled(true);
|
|
326
|
-
setInputMessageDisabled(true);
|
|
327
|
-
const responseError = await createItemsChat([
|
|
328
|
-
{
|
|
329
|
-
type: "message",
|
|
330
|
-
value: valueInputMessage.trim(),
|
|
331
|
-
},
|
|
332
|
-
]);
|
|
333
|
-
setInputMessageDisabled(false);
|
|
334
|
-
setBtnSendMessageLoading(false);
|
|
335
|
-
setBtnChooserFileDisabled(false);
|
|
336
|
-
if (responseError) {
|
|
337
|
-
setModalAlert({
|
|
338
|
-
show: true,
|
|
339
|
-
title: responseError.message,
|
|
340
|
-
message: responseError.errorDetail,
|
|
341
|
-
errorInputMessage: true,
|
|
342
|
-
});
|
|
343
|
-
} else {
|
|
344
|
-
setValueInputMessage("");
|
|
345
|
-
setToggleFocusInputMessage((prev) => !prev);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
const disableSecondaryContainer = (disabled = false) => {
|
|
351
|
-
setBtnSendFilesLoading(disabled);
|
|
352
|
-
setBtnChooserFileDisabled(disabled);
|
|
353
|
-
setOpenPreview(!disabled);
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
const deleteFile = async (index) => {
|
|
357
|
-
let newFiles = filesPreview.slice();
|
|
358
|
-
newFiles.splice(index, 1);
|
|
359
|
-
setFilesPreview(newFiles);
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
const renderFilesPreview = async () => {
|
|
363
|
-
const jsxFiles = [];
|
|
364
|
-
for (let index = 0; index < filesPreview.length; index++) {
|
|
365
|
-
const file = filesPreview[index];
|
|
366
|
-
const fileType = file.type?.split("/")[0];
|
|
367
|
-
const base64 = await getBase64(file);
|
|
368
|
-
jsxFiles.push(
|
|
369
|
-
<SwiperSlide className="item-carrousel" key={"item-" + index}>
|
|
370
|
-
<ContainerItemCarrousel>
|
|
371
|
-
{fileType === "image" ? (
|
|
372
|
-
<CustomImage
|
|
373
|
-
width={"100%"}
|
|
374
|
-
className={"container-img"}
|
|
375
|
-
sizeLoading={40}
|
|
376
|
-
colorLoading={undefined}
|
|
377
|
-
src={base64}
|
|
378
|
-
componentDefault={
|
|
379
|
-
<CustomIcon
|
|
380
|
-
className="icon-img"
|
|
381
|
-
size={60}
|
|
382
|
-
icon={IconImage}
|
|
383
|
-
type={"pink"}
|
|
384
|
-
transparent
|
|
385
|
-
/>
|
|
386
|
-
}
|
|
387
|
-
/>
|
|
388
|
-
) : (
|
|
389
|
-
<IconFile
|
|
390
|
-
transparent
|
|
391
|
-
size={60}
|
|
392
|
-
ext={getFileExtension(file.name)}
|
|
393
|
-
/>
|
|
394
|
-
)}
|
|
395
|
-
|
|
396
|
-
<div
|
|
397
|
-
className="container-delete"
|
|
398
|
-
onMouseEnter={() => {
|
|
399
|
-
setTooltipFileName({
|
|
400
|
-
show: true,
|
|
401
|
-
fileName: file.name,
|
|
402
|
-
});
|
|
403
|
-
}}
|
|
404
|
-
onMouseLeave={() => {
|
|
405
|
-
setTooltipFileName({
|
|
406
|
-
show: false,
|
|
407
|
-
fileName: "",
|
|
408
|
-
});
|
|
409
|
-
}}
|
|
410
|
-
>
|
|
411
|
-
<ButtonV2
|
|
412
|
-
className="btn-delete"
|
|
413
|
-
type={"white"}
|
|
414
|
-
label={"Eliminar"}
|
|
415
|
-
size={8}
|
|
416
|
-
borderType={"oval"}
|
|
417
|
-
icon={IconDelete}
|
|
418
|
-
isLoading={undefined}
|
|
419
|
-
onClick={async (event) => {
|
|
420
|
-
deleteFile(index);
|
|
421
|
-
}}
|
|
422
|
-
/>
|
|
423
|
-
</div>
|
|
424
|
-
</ContainerItemCarrousel>
|
|
425
|
-
</SwiperSlide>
|
|
426
|
-
);
|
|
427
|
-
}
|
|
428
|
-
setFilesJsxPreview(jsxFiles);
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
const onChangeFiles = async (selectedFiles) => {
|
|
432
|
-
let newFiles = filesPreview.slice();
|
|
433
|
-
newFiles = newFiles.concat(selectedFiles);
|
|
434
|
-
setFilesPreview(newFiles);
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
const getErrorUpdate = () => {
|
|
438
|
-
if (errorUpdate?.startDate) {
|
|
439
|
-
let errorDetail = "Ultima actualización hace ";
|
|
440
|
-
if (errorUpdate?.lastDate) {
|
|
441
|
-
let msDif =
|
|
442
|
-
errorUpdate.lastDate.getTime() - errorUpdate.startDate.getTime();
|
|
443
|
-
const minutes = Math.floor(msDif / 60000);
|
|
444
|
-
const hours = Math.floor(minutes / 60);
|
|
445
|
-
if (hours === 0) {
|
|
446
|
-
if (minutes === 0) errorDetail += "menos de 1 minuto";
|
|
447
|
-
else if (minutes === 1) errorDetail += "1 minuto";
|
|
448
|
-
else errorDetail += minutes + " minutos";
|
|
449
|
-
} else {
|
|
450
|
-
if (hours === 1) errorDetail += "1 hora con ";
|
|
451
|
-
else errorDetail += hours + " horas con ";
|
|
452
|
-
|
|
453
|
-
if (minutes === 0) errorDetail += "menos de 1 minuto";
|
|
454
|
-
else if (minutes === 1) errorDetail += "1 minuto";
|
|
455
|
-
else errorDetail += minutes + " minutos";
|
|
456
|
-
}
|
|
457
|
-
} else {
|
|
458
|
-
errorDetail += "menos de 1 minuto";
|
|
459
|
-
}
|
|
460
|
-
// retornar el icono
|
|
461
|
-
return (
|
|
462
|
-
<Tooltip
|
|
463
|
-
componentTooltip={
|
|
464
|
-
<div>
|
|
465
|
-
<label className="label-title">Chat desactualizado</label>
|
|
466
|
-
<label className="label-detail">{errorDetail}</label>
|
|
467
|
-
</div>
|
|
468
|
-
}
|
|
469
|
-
className="container-ErrorUpdate"
|
|
470
|
-
classNameTooltip="tooltipErrorUpdate"
|
|
471
|
-
position={"topCenter"}
|
|
472
|
-
addArrow={false}
|
|
473
|
-
transitionType={"zoom"}
|
|
474
|
-
followCursor={false}
|
|
475
|
-
>
|
|
476
|
-
<CustomIcon
|
|
477
|
-
className="icon-errorUpdate"
|
|
478
|
-
size={15}
|
|
479
|
-
icon={IconWarning}
|
|
480
|
-
type={"pink"}
|
|
481
|
-
transparent
|
|
482
|
-
/>
|
|
483
|
-
</Tooltip>
|
|
484
|
-
);
|
|
485
|
-
} else {
|
|
486
|
-
return null;
|
|
487
|
-
}
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
return (
|
|
491
|
-
<>
|
|
492
|
-
<Container ref={containerRef}>
|
|
493
|
-
{statusChat === "closed" ? (
|
|
494
|
-
<>
|
|
495
|
-
{/* chat bloqueado */}
|
|
496
|
-
<div className="container-chatDisabled">
|
|
497
|
-
{/* icono de chat desactualizado */}
|
|
498
|
-
{getErrorUpdate()}
|
|
499
|
-
|
|
500
|
-
<div className="label-chatDisabled">{messageDisabled}</div>
|
|
501
|
-
</div>
|
|
502
|
-
</>
|
|
503
|
-
) : filesJsxPreview.length === 0 ? (
|
|
504
|
-
<>
|
|
505
|
-
{/* container del input y el btn sendTXT */}
|
|
506
|
-
<ContainerMain>
|
|
507
|
-
{/* icono de chat desactualizado */}
|
|
508
|
-
{getErrorUpdate()}
|
|
509
|
-
|
|
510
|
-
<InputText
|
|
511
|
-
className="input-itemMessage"
|
|
512
|
-
type="gray"
|
|
513
|
-
transparent
|
|
514
|
-
size={13}
|
|
515
|
-
placeHolder="Escribe aquí..."
|
|
516
|
-
multiline
|
|
517
|
-
maxRows={5}
|
|
518
|
-
minRows={1}
|
|
519
|
-
disabled={inputMessageDisabled}
|
|
520
|
-
text={valueInputMessage}
|
|
521
|
-
onChangeText={(newValue) => setValueInputMessage(newValue)}
|
|
522
|
-
onEnter={async (event) => await sendMessage()}
|
|
523
|
-
refInputText={refInputTextMessage}
|
|
524
|
-
/>
|
|
525
|
-
|
|
526
|
-
{/* selector de files */}
|
|
527
|
-
<ButtonFileChooser
|
|
528
|
-
className="btn-chooserFiles"
|
|
529
|
-
type={"gray"}
|
|
530
|
-
transparent
|
|
531
|
-
size={18}
|
|
532
|
-
disabled={btnChooserFileDisabled}
|
|
533
|
-
showIcon={true}
|
|
534
|
-
multipleFiles={true}
|
|
535
|
-
onChangeFiles={onChangeFiles}
|
|
536
|
-
/>
|
|
537
|
-
|
|
538
|
-
{/* boton send message */}
|
|
539
|
-
<ButtonV2
|
|
540
|
-
className="btn-sendMessage"
|
|
541
|
-
type={"pink"}
|
|
542
|
-
size={10}
|
|
543
|
-
borderType={"circle"}
|
|
544
|
-
icon={IconSend}
|
|
545
|
-
isLoading={btnSendMessageLoading}
|
|
546
|
-
onClick={async (event) => {
|
|
547
|
-
await sendMessage();
|
|
548
|
-
}}
|
|
549
|
-
/>
|
|
550
|
-
</ContainerMain>
|
|
551
|
-
</>
|
|
552
|
-
) : (
|
|
553
|
-
<>
|
|
554
|
-
{/* container para el modo previewFiles */}
|
|
555
|
-
<TooltipMUI
|
|
556
|
-
open={openPreview}
|
|
557
|
-
placement={"top-start"}
|
|
558
|
-
arrow={false}
|
|
559
|
-
componentsProps={{
|
|
560
|
-
popper: {
|
|
561
|
-
className: "tooltip-previewFiles",
|
|
562
|
-
disablePortal: true,
|
|
563
|
-
},
|
|
564
|
-
transition: { timeout: 300 },
|
|
565
|
-
}}
|
|
566
|
-
title={
|
|
567
|
-
<TooltipMUI
|
|
568
|
-
open={tooltipFileName.show}
|
|
569
|
-
placement={"top"}
|
|
570
|
-
arrow={false}
|
|
571
|
-
followCursor={true}
|
|
572
|
-
TransitionComponent={Fade}
|
|
573
|
-
componentsProps={{
|
|
574
|
-
popper: {
|
|
575
|
-
className: "tooltip-previewFileName",
|
|
576
|
-
disablePortal: true,
|
|
577
|
-
},
|
|
578
|
-
transition: { timeout: 300 },
|
|
579
|
-
}}
|
|
580
|
-
title={<label>{tooltipFileName.fileName}</label>}
|
|
581
|
-
>
|
|
582
|
-
<div className="container-carrouselFiles">
|
|
583
|
-
<Swiper
|
|
584
|
-
spaceBetween={5}
|
|
585
|
-
slidesPerView={"auto"}
|
|
586
|
-
freeMode
|
|
587
|
-
mousewheel
|
|
588
|
-
keyboard
|
|
589
|
-
modules={[Mousewheel, Keyboard, FreeMode]}
|
|
590
|
-
className="carrousel-files"
|
|
591
|
-
>
|
|
592
|
-
{filesJsxPreview}
|
|
593
|
-
</Swiper>
|
|
594
|
-
</div>
|
|
595
|
-
</TooltipMUI>
|
|
596
|
-
}
|
|
597
|
-
>
|
|
598
|
-
<ContainerSecondary>
|
|
599
|
-
{/* icono de chat desactualizado */}
|
|
600
|
-
{getErrorUpdate()}
|
|
601
|
-
|
|
602
|
-
{/* selector de files */}
|
|
603
|
-
<Slide
|
|
604
|
-
direction={"left"}
|
|
605
|
-
in={true}
|
|
606
|
-
timeout={500}
|
|
607
|
-
container={containerRef.current}
|
|
608
|
-
>
|
|
609
|
-
<div>
|
|
610
|
-
<ButtonFileChooser
|
|
611
|
-
className={"btn-chooserFiles"}
|
|
612
|
-
type={"gray"}
|
|
613
|
-
size={17}
|
|
614
|
-
borderType="circle"
|
|
615
|
-
showIcon={true}
|
|
616
|
-
disabled={btnChooserFileDisabled}
|
|
617
|
-
multipleFiles={true}
|
|
618
|
-
onChangeFiles={onChangeFiles}
|
|
619
|
-
/>
|
|
620
|
-
</div>
|
|
621
|
-
</Slide>
|
|
622
|
-
|
|
623
|
-
{/* boton send files */}
|
|
624
|
-
<Slide
|
|
625
|
-
direction={"up"}
|
|
626
|
-
in={true}
|
|
627
|
-
timeout={500}
|
|
628
|
-
container={containerRef.current}
|
|
629
|
-
>
|
|
630
|
-
<div className="slide-btnSendFiles">
|
|
631
|
-
<ButtonV2
|
|
632
|
-
className="btn-sendFiles"
|
|
633
|
-
type={"pink"}
|
|
634
|
-
label={"Enviar archivos"}
|
|
635
|
-
size={12}
|
|
636
|
-
borderType={"oval"}
|
|
637
|
-
loading={btnSendFilesLoading}
|
|
638
|
-
isLoading={btnSendFilesLoading}
|
|
639
|
-
onClick={async (event) => {
|
|
640
|
-
await sendFilesPreview();
|
|
641
|
-
}}
|
|
642
|
-
/>
|
|
643
|
-
</div>
|
|
644
|
-
</Slide>
|
|
645
|
-
</ContainerSecondary>
|
|
646
|
-
</TooltipMUI>
|
|
647
|
-
</>
|
|
648
|
-
)}
|
|
649
|
-
</Container>
|
|
650
|
-
|
|
651
|
-
<Modal
|
|
652
|
-
className="container-modalAlert"
|
|
653
|
-
show={modalAlert.show}
|
|
654
|
-
title={modalAlert.title}
|
|
655
|
-
message={modalAlert.message}
|
|
656
|
-
icon={"info"}
|
|
657
|
-
onClickBtnDefault={(event) => {
|
|
658
|
-
setModalAlert((prev) => ({
|
|
659
|
-
...prev,
|
|
660
|
-
show: false,
|
|
661
|
-
errorInputMessage: false,
|
|
662
|
-
}));
|
|
663
|
-
setToggleFocusInputMessage((prev) => !prev);
|
|
664
|
-
}}
|
|
665
|
-
/>
|
|
666
|
-
</>
|
|
667
|
-
);
|
|
668
|
-
};
|