agx-chat-web 1.1.0 → 1.2.1

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 (86) hide show
  1. package/README.md +49 -49
  2. package/dist/agx-chat.esm.js +1 -1
  3. package/dist/agx-chat.esm.js.map +1 -1
  4. package/dist/{agx-chat.min.js → agx-chat.umd.js} +2 -2
  5. package/dist/agx-chat.umd.js.map +1 -0
  6. package/dist/esm/app/Messenger/components/IncomingMessage/IncomingMessage.js +7 -3
  7. package/dist/esm/app/Messenger/components/IncomingMessage/IncomingMessage.js.map +1 -1
  8. package/dist/esm/app/Messenger/components/InputFile/InputFile.js +3 -1
  9. package/dist/esm/app/Messenger/components/InputFile/InputFile.js.map +1 -1
  10. package/dist/esm/app/Messenger/components/RenderFileIcon/RenderFileIcon.js +8 -0
  11. package/dist/esm/app/Messenger/components/RenderFileIcon/RenderFileIcon.js.map +1 -1
  12. package/dist/esm/app/Messenger/components/SendMessageForm/SendMessageForm.js +30 -8
  13. package/dist/esm/app/Messenger/components/SendMessageForm/SendMessageForm.js.map +1 -1
  14. package/dist/esm/app/Messenger/components/SenderMessages/SenderMessages.js +11 -8
  15. package/dist/esm/app/Messenger/components/SenderMessages/SenderMessages.js.map +1 -1
  16. package/dist/esm/app/Messenger/icons/CSVFileIcon.d.ts +4 -0
  17. package/dist/esm/app/Messenger/icons/CSVFileIcon.js +7 -0
  18. package/dist/esm/app/Messenger/icons/CSVFileIcon.js.map +1 -0
  19. package/dist/esm/app/Messenger/icons/MP4FileIcon.d.ts +4 -0
  20. package/dist/esm/app/Messenger/icons/MP4FileIcon.js +7 -0
  21. package/dist/esm/app/Messenger/icons/MP4FileIcon.js.map +1 -0
  22. package/package.json +91 -91
  23. package/src/__tests__/app/Messenger/classes/slaCalculations.spec.ts +122 -122
  24. package/src/app/ChatProvider/ChatProvider.tsx +20 -20
  25. package/src/app/Messenger/classes/slaCalculations.ts +197 -197
  26. package/src/app/Messenger/components/ChatButton/ChatButton.tsx +64 -64
  27. package/src/app/Messenger/components/ChatTabs/ChatTabs.less +18 -18
  28. package/src/app/Messenger/components/ChatTabs/ChatTabs.tsx +32 -32
  29. package/src/app/Messenger/components/DocMessage/DocMessage.less +71 -71
  30. package/src/app/Messenger/components/DocMessage/DocMessage.tsx +50 -50
  31. package/src/app/Messenger/components/ImagesContainer/ImagesContainer.less +79 -79
  32. package/src/app/Messenger/components/ImagesContainer/ImagesContainer.tsx +51 -51
  33. package/src/app/Messenger/components/IncomingMessage/IncomingMessage.tsx +170 -166
  34. package/src/app/Messenger/components/InfiniteScroll/InfiniteScroll.tsx +80 -80
  35. package/src/app/Messenger/components/InputFile/InputFile.tsx +147 -145
  36. package/src/app/Messenger/components/InputFile/inputFile.less +59 -59
  37. package/src/app/Messenger/components/MessageBallon/MessageBalloon.tsx +100 -100
  38. package/src/app/Messenger/components/MessengerAvatar/MessengerAvatar.tsx +29 -29
  39. package/src/app/Messenger/components/MessengerThemeWrapper/MessengerThemeWrapper.tsx +62 -62
  40. package/src/app/Messenger/components/RenderFileIcon/RenderFileIcon.tsx +40 -34
  41. package/src/app/Messenger/components/SearchInput/SearchInput.less +45 -45
  42. package/src/app/Messenger/components/SearchInput/SearchInput.tsx +77 -77
  43. package/src/app/Messenger/components/Select/Select.less +22 -22
  44. package/src/app/Messenger/components/Select/Select.tsx +56 -56
  45. package/src/app/Messenger/components/SendMessageForm/SendMessageForm.tsx +254 -234
  46. package/src/app/Messenger/components/SenderMessages/SenderMessages.tsx +91 -89
  47. package/src/app/Messenger/components/SystemMessage/SystemMessage.tsx +25 -25
  48. package/src/app/Messenger/components/TextArea/TextArea.tsx +35 -35
  49. package/src/app/Messenger/components/TextArea/Textarea.less +22 -22
  50. package/src/app/Messenger/components/Tooltip/Tooltip.less +27 -27
  51. package/src/app/Messenger/components/Tooltip/Tooltip.tsx +17 -17
  52. package/src/app/Messenger/hooks/useConversations.tsx +143 -143
  53. package/src/app/Messenger/hooks/useMessages.tsx +49 -49
  54. package/src/app/Messenger/hooks/useThemes.tsx +14 -14
  55. package/src/app/Messenger/icons/AttachFileIcon.tsx +20 -20
  56. package/src/app/Messenger/icons/CSVFileIcon.tsx +26 -0
  57. package/src/app/Messenger/icons/CloseIcon.tsx +20 -20
  58. package/src/app/Messenger/icons/DOCFileIcon.tsx +54 -54
  59. package/src/app/Messenger/icons/DownloadMinimalistIcon.tsx +37 -37
  60. package/src/app/Messenger/icons/EmptyIcon.tsx +20 -20
  61. package/src/app/Messenger/icons/MP4FileIcon.tsx +26 -0
  62. package/src/app/Messenger/icons/MessageIcon.tsx +27 -27
  63. package/src/app/Messenger/icons/PDFFileIcon.tsx +54 -54
  64. package/src/app/Messenger/icons/ReadIcon.tsx +18 -18
  65. package/src/app/Messenger/icons/SearchIcon.tsx +20 -20
  66. package/src/app/Messenger/icons/TimerIcon.tsx +18 -18
  67. package/src/app/Messenger/icons/TrashIcon.tsx +21 -21
  68. package/src/app/Messenger/views/Messenger.less +623 -623
  69. package/src/app/Messenger/views/MessengerList.tsx +170 -170
  70. package/src/app/Messenger/views/MessengerListItem.tsx +178 -178
  71. package/src/app/Messenger/views/MessengerMessages.tsx +414 -414
  72. package/src/app/Messenger/views/NewFormChat.tsx +145 -145
  73. package/src/app/i18n/index.ts +36 -36
  74. package/src/app/i18n/locales/en.json +64 -64
  75. package/src/app/i18n/locales/pt.json +64 -64
  76. package/src/assets/right-arrow.svg +9 -9
  77. package/src/index.ts +23 -23
  78. package/src/react-app-env.d.ts +19 -19
  79. package/src/setupTests.ts +5 -5
  80. package/src/styles/abstracts/animations.less +8 -8
  81. package/src/styles/abstracts/mixins.less +5 -5
  82. package/src/styles/abstracts/variables.less +31 -31
  83. package/src/styles/base/base.less +6 -6
  84. package/src/styles/index.less +5 -5
  85. package/src/types.ts +174 -174
  86. package/dist/agx-chat.min.js.map +0 -1
@@ -1,62 +1,62 @@
1
- import React, { createContext, ReactNode } from 'react'
2
-
3
- const defaultThemeVariables = {
4
- asideBg: '#eee',
5
- asideFontColor: 'var(--secondary-color)',
6
- messengerMessagesBg: '#eeeeee',
7
- headerAndSenderBg: '#232831',
8
- buttonPrimary: '#25D366',
9
- buttonPrimaryText: '#707070',
10
- buttonsDisabled: '#94989D',
11
- uploadFileIconColor: '#8696a0',
12
- messengerNotSelectedBg: '#DDDDDD',
13
- newChatFormBg: '',
14
- newChatFormRadius: '0 20px 20px 0',
15
- newChatFormTexts: '#000',
16
- newChatFormDeleteFileButton: '#DD4E4E',
17
- disclaimerPrimaryColor: '#4791FF',
18
- disclaimerSecondaryColor: '#4791FF',
19
- disclaimerTextColor: '#000',
20
- messengerSenderColor: '#00A73E',
21
- messengerIncomerColor: '#707070',
22
- messengerSystemColor: '#2A313A',
23
- borderColor: '#AAAAAA',
24
- inputBg: 'var(--secondary-color)',
25
- chatInputBorder: '',
26
- listItemHover: '',
27
- active: '',
28
- activeTabBorter: '#25D366',
29
- emptyMessagesFontColor: '#000',
30
- documentMessagesTextColor: '#fff',
31
- }
32
-
33
- type ThemeVariables = typeof defaultThemeVariables
34
-
35
- type ThemeContextContent = {
36
- theme: Partial<ThemeVariables>
37
- }
38
-
39
- export const MessageThemeContext = createContext<ThemeContextContent>(
40
- {} as unknown as ThemeContextContent
41
- )
42
-
43
- type Props = {
44
- children: ReactNode
45
- theme?: Partial<ThemeVariables>
46
- }
47
- const MessageThemeWrapper = ({
48
- children,
49
- theme = defaultThemeVariables,
50
- }: Props) => {
51
- const config = {
52
- theme,
53
- }
54
-
55
- return (
56
- <MessageThemeContext.Provider value={config}>
57
- {children}
58
- </MessageThemeContext.Provider>
59
- )
60
- }
61
-
62
- export default MessageThemeWrapper
1
+ import React, { createContext, ReactNode } from 'react'
2
+
3
+ const defaultThemeVariables = {
4
+ asideBg: '#eee',
5
+ asideFontColor: 'var(--secondary-color)',
6
+ messengerMessagesBg: '#eeeeee',
7
+ headerAndSenderBg: '#232831',
8
+ buttonPrimary: '#25D366',
9
+ buttonPrimaryText: '#707070',
10
+ buttonsDisabled: '#94989D',
11
+ uploadFileIconColor: '#8696a0',
12
+ messengerNotSelectedBg: '#DDDDDD',
13
+ newChatFormBg: '',
14
+ newChatFormRadius: '0 20px 20px 0',
15
+ newChatFormTexts: '#000',
16
+ newChatFormDeleteFileButton: '#DD4E4E',
17
+ disclaimerPrimaryColor: '#4791FF',
18
+ disclaimerSecondaryColor: '#4791FF',
19
+ disclaimerTextColor: '#000',
20
+ messengerSenderColor: '#00A73E',
21
+ messengerIncomerColor: '#707070',
22
+ messengerSystemColor: '#2A313A',
23
+ borderColor: '#AAAAAA',
24
+ inputBg: 'var(--secondary-color)',
25
+ chatInputBorder: '',
26
+ listItemHover: '',
27
+ active: '',
28
+ activeTabBorter: '#25D366',
29
+ emptyMessagesFontColor: '#000',
30
+ documentMessagesTextColor: '#fff',
31
+ }
32
+
33
+ type ThemeVariables = typeof defaultThemeVariables
34
+
35
+ type ThemeContextContent = {
36
+ theme: Partial<ThemeVariables>
37
+ }
38
+
39
+ export const MessageThemeContext = createContext<ThemeContextContent>(
40
+ {} as unknown as ThemeContextContent
41
+ )
42
+
43
+ type Props = {
44
+ children: ReactNode
45
+ theme?: Partial<ThemeVariables>
46
+ }
47
+ const MessageThemeWrapper = ({
48
+ children,
49
+ theme = defaultThemeVariables,
50
+ }: Props) => {
51
+ const config = {
52
+ theme,
53
+ }
54
+
55
+ return (
56
+ <MessageThemeContext.Provider value={config}>
57
+ {children}
58
+ </MessageThemeContext.Provider>
59
+ )
60
+ }
61
+
62
+ export default MessageThemeWrapper
@@ -1,34 +1,40 @@
1
- import React from 'react'
2
- import FileDoc from '../../icons/DOCFileIcon'
3
- import FilePdf from '../../icons/PDFFileIcon'
4
- import { useTranslation } from 'react-i18next'
5
-
6
- const RenderFileIcon = ({
7
- fileType,
8
- b64,
9
- }: {
10
- fileType?: string
11
- b64?: string
12
- }) => {
13
- const { t } = useTranslation('messengerMessages')
14
-
15
- if (fileType === 'application/pdf') {
16
- return <FilePdf width='40' height='40' />
17
- } else if (
18
- fileType === 'application/msword' ||
19
- fileType ===
20
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
21
- ) {
22
- return <FileDoc width='40' height='40' />
23
- } else {
24
- return (
25
- <img
26
- alt={t('renderFileIcon.altImage')}
27
- src={b64}
28
- className='images-container__image'
29
- />
30
- )
31
- }
32
- }
33
-
34
- export default RenderFileIcon
1
+ import React from 'react'
2
+ import FileDoc from '../../icons/DOCFileIcon'
3
+ import FilePdf from '../../icons/PDFFileIcon'
4
+ import CSVFileIcon from '../../icons/CSVFileIcon'
5
+ import MP4FileIcon from '../../icons/MP4FileIcon'
6
+ import { useTranslation } from 'react-i18next'
7
+
8
+ const RenderFileIcon = ({
9
+ fileType,
10
+ b64,
11
+ }: {
12
+ fileType?: string
13
+ b64?: string
14
+ }) => {
15
+ const { t } = useTranslation('messengerMessages')
16
+
17
+ if (fileType === 'application/pdf') {
18
+ return <FilePdf width='40' height='40' />
19
+ } else if (
20
+ fileType === 'application/msword' ||
21
+ fileType ===
22
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
23
+ ) {
24
+ return <FileDoc width='40' height='40' />
25
+ } else if (fileType === 'text/csv') {
26
+ return <CSVFileIcon width='40' height='40' />
27
+ } else if (fileType === 'video/mp4') {
28
+ return <MP4FileIcon width='40' height='40' />
29
+ } else {
30
+ return (
31
+ <img
32
+ alt={t('renderFileIcon.altImage')}
33
+ src={b64}
34
+ className='images-container__image'
35
+ />
36
+ )
37
+ }
38
+ }
39
+
40
+ export default RenderFileIcon
@@ -1,45 +1,45 @@
1
- .input-search {
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- width: 100%;
6
- margin: 1rem 0;
7
- position: relative;
8
-
9
- &__select {
10
- border-radius: 30px 0 0 30px;
11
- padding: 10px;
12
- background: transparent;
13
- margin-left: 1rem;
14
- width: 30%;
15
- }
16
-
17
- &__option {
18
- color: black;
19
- }
20
-
21
- &__search {
22
- width: 70%;
23
- margin-right: 1rem;
24
- border-radius: 0 30px 30px 0;
25
- padding: 9px;
26
- color: var(--secondary-color);
27
- border: var(--secondary-color) 1px solid;
28
- background: transparent;
29
- position: relative;
30
-
31
- &::placeholder {
32
- color: var(--secondary-color);
33
- opacity: 60%;
34
- }
35
- }
36
-
37
- &__icon {
38
- border: none;
39
- background: transparent;
40
- position: absolute;
41
- right: 2rem;
42
- display: flex;
43
- cursor: pointer;
44
- }
45
- }
1
+ .input-search {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ width: 100%;
6
+ margin: 1rem 0;
7
+ position: relative;
8
+
9
+ &__select {
10
+ border-radius: 30px 0 0 30px;
11
+ padding: 10px;
12
+ background: transparent;
13
+ margin-left: 1rem;
14
+ width: 30%;
15
+ }
16
+
17
+ &__option {
18
+ color: black;
19
+ }
20
+
21
+ &__search {
22
+ width: 70%;
23
+ margin-right: 1rem;
24
+ border-radius: 0 30px 30px 0;
25
+ padding: 9px;
26
+ color: var(--secondary-color);
27
+ border: var(--secondary-color) 1px solid;
28
+ background: transparent;
29
+ position: relative;
30
+
31
+ &::placeholder {
32
+ color: var(--secondary-color);
33
+ opacity: 60%;
34
+ }
35
+ }
36
+
37
+ &__icon {
38
+ border: none;
39
+ background: transparent;
40
+ position: absolute;
41
+ right: 2rem;
42
+ display: flex;
43
+ cursor: pointer;
44
+ }
45
+ }
@@ -1,77 +1,77 @@
1
- import SearchIcon from '../../icons/SearchIcon'
2
- import React, { useState } from 'react'
3
- import useTheme from '../../hooks/useThemes'
4
- import { useTranslation } from 'react-i18next'
5
-
6
- interface IProps {
7
- searchChat: (value: string, key: string) => void
8
- searchKeys: { label: string; value: string }[]
9
- loadingSearch: boolean
10
- }
11
-
12
- function SearchInput ({ searchChat, searchKeys, loadingSearch }: IProps) {
13
- const { t } = useTranslation('messengerList')
14
- const [searchKey, setSearchKey] = useState<string>(searchKeys[0].value)
15
- const [searchValue, setSearchValue] = useState<string>('')
16
- const { theme } = useTheme()
17
-
18
- const onSearch = (event: React.ChangeEvent<HTMLInputElement>) => {
19
- setSearchValue(event.target.value)
20
- }
21
-
22
- const handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {
23
- if (event.key === 'Enter') {
24
- searchChat(searchValue, searchKey)
25
- }
26
- }
27
-
28
- return (
29
- <div className='input-search'>
30
- <select
31
- className='input-search__select'
32
- onChange={(e) => setSearchKey(e.target.value)}
33
- style={{
34
- color: theme.asideFontColor,
35
- border: `${theme.asideFontColor} 1px solid`,
36
- }}
37
- >
38
- {searchKeys.map((item, index) => (
39
- <option
40
- className='input-search__option'
41
- key={index}
42
- value={item.value}
43
- >
44
- {item.label}
45
- </option>
46
- ))}
47
- </select>
48
-
49
- <input
50
- className='input-search__search'
51
- placeholder={t('searchInput.placeholder')}
52
- onChange={onSearch}
53
- onKeyDown={handleKeyPress}
54
- style={{
55
- color: theme.asideFontColor,
56
- border: `${theme.asideFontColor} 1px solid`,
57
- borderLeft: 0,
58
- }}
59
- />
60
-
61
- <button
62
- className='input-search__icon'
63
- onClick={() => searchChat(searchValue, searchKey)}
64
- >
65
- {loadingSearch ? (
66
- <div className='messenger__messages-loading'>
67
- <div className='messenger__messages-loading--loader' />
68
- </div>
69
- ) : (
70
- <SearchIcon />
71
- )}
72
- </button>
73
- </div>
74
- )
75
- }
76
-
77
- export default SearchInput
1
+ import SearchIcon from '../../icons/SearchIcon'
2
+ import React, { useState } from 'react'
3
+ import useTheme from '../../hooks/useThemes'
4
+ import { useTranslation } from 'react-i18next'
5
+
6
+ interface IProps {
7
+ searchChat: (value: string, key: string) => void
8
+ searchKeys: { label: string; value: string }[]
9
+ loadingSearch: boolean
10
+ }
11
+
12
+ function SearchInput ({ searchChat, searchKeys, loadingSearch }: IProps) {
13
+ const { t } = useTranslation('messengerList')
14
+ const [searchKey, setSearchKey] = useState<string>(searchKeys[0].value)
15
+ const [searchValue, setSearchValue] = useState<string>('')
16
+ const { theme } = useTheme()
17
+
18
+ const onSearch = (event: React.ChangeEvent<HTMLInputElement>) => {
19
+ setSearchValue(event.target.value)
20
+ }
21
+
22
+ const handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {
23
+ if (event.key === 'Enter') {
24
+ searchChat(searchValue, searchKey)
25
+ }
26
+ }
27
+
28
+ return (
29
+ <div className='input-search'>
30
+ <select
31
+ className='input-search__select'
32
+ onChange={(e) => setSearchKey(e.target.value)}
33
+ style={{
34
+ color: theme.asideFontColor,
35
+ border: `${theme.asideFontColor} 1px solid`,
36
+ }}
37
+ >
38
+ {searchKeys.map((item, index) => (
39
+ <option
40
+ className='input-search__option'
41
+ key={index}
42
+ value={item.value}
43
+ >
44
+ {item.label}
45
+ </option>
46
+ ))}
47
+ </select>
48
+
49
+ <input
50
+ className='input-search__search'
51
+ placeholder={t('searchInput.placeholder')}
52
+ onChange={onSearch}
53
+ onKeyDown={handleKeyPress}
54
+ style={{
55
+ color: theme.asideFontColor,
56
+ border: `${theme.asideFontColor} 1px solid`,
57
+ borderLeft: 0,
58
+ }}
59
+ />
60
+
61
+ <button
62
+ className='input-search__icon'
63
+ onClick={() => searchChat(searchValue, searchKey)}
64
+ >
65
+ {loadingSearch ? (
66
+ <div className='messenger__messages-loading'>
67
+ <div className='messenger__messages-loading--loader' />
68
+ </div>
69
+ ) : (
70
+ <SearchIcon />
71
+ )}
72
+ </button>
73
+ </div>
74
+ )
75
+ }
76
+
77
+ export default SearchInput
@@ -1,22 +1,22 @@
1
- .form-select {
2
- margin-bottom: 1rem;
3
- width: 100%;
4
-
5
- &__label {
6
- color: @title-form-color;
7
- font-weight: bold;
8
- margin: 0.5rem;
9
- }
10
-
11
- &__input {
12
- border: 1.5px solid hsl(0, 0%, 80%);
13
- border-radius: 4px;
14
- margin-top: 0.5rem;
15
- padding: 8px 8px;
16
- width: 100%;
17
-
18
- &:focus {
19
- outline: #2684ff 2px solid !important;
20
- }
21
- }
22
- }
1
+ .form-select {
2
+ margin-bottom: 1rem;
3
+ width: 100%;
4
+
5
+ &__label {
6
+ color: @title-form-color;
7
+ font-weight: bold;
8
+ margin: 0.5rem;
9
+ }
10
+
11
+ &__input {
12
+ border: 1.5px solid hsl(0, 0%, 80%);
13
+ border-radius: 4px;
14
+ margin-top: 0.5rem;
15
+ padding: 8px 8px;
16
+ width: 100%;
17
+
18
+ &:focus {
19
+ outline: #2684ff 2px solid !important;
20
+ }
21
+ }
22
+ }
@@ -1,56 +1,56 @@
1
- import React from 'react'
2
- import useTheme from '../../hooks/useThemes'
3
- interface IProps {
4
- options: {
5
- label: string
6
- value: string
7
- }[]
8
- label: string
9
- onChange: (value: string) => void
10
- name: string
11
- placeholder: string
12
- value: string
13
- }
14
-
15
- function SelectNew ({
16
- options,
17
- name,
18
- placeholder,
19
- label,
20
- onChange,
21
- value,
22
- }: IProps) {
23
- const { theme } = useTheme()
24
- return (
25
- <div className='form-select'>
26
- <label
27
- htmlFor={name}
28
- className='form-select__label'
29
- style={{ color: theme.newChatFormTexts }}
30
- >
31
- {label}
32
- </label>
33
- <select
34
- name={name}
35
- className='form-select__input'
36
- onChange={(e) => onChange(e.target.value)}
37
- value={value}
38
- style={{
39
- backgroundColor: theme.inputBg,
40
- color: theme.newChatFormTexts,
41
- }}
42
- >
43
- <option value='' disabled hidden>
44
- {placeholder}
45
- </option>
46
- {options.map((motivo) => (
47
- <option key={motivo.value} value={motivo.value}>
48
- {motivo.label}
49
- </option>
50
- ))}
51
- </select>
52
- </div>
53
- )
54
- }
55
-
56
- export default SelectNew
1
+ import React from 'react'
2
+ import useTheme from '../../hooks/useThemes'
3
+ interface IProps {
4
+ options: {
5
+ label: string
6
+ value: string
7
+ }[]
8
+ label: string
9
+ onChange: (value: string) => void
10
+ name: string
11
+ placeholder: string
12
+ value: string
13
+ }
14
+
15
+ function SelectNew ({
16
+ options,
17
+ name,
18
+ placeholder,
19
+ label,
20
+ onChange,
21
+ value,
22
+ }: IProps) {
23
+ const { theme } = useTheme()
24
+ return (
25
+ <div className='form-select'>
26
+ <label
27
+ htmlFor={name}
28
+ className='form-select__label'
29
+ style={{ color: theme.newChatFormTexts }}
30
+ >
31
+ {label}
32
+ </label>
33
+ <select
34
+ name={name}
35
+ className='form-select__input'
36
+ onChange={(e) => onChange(e.target.value)}
37
+ value={value}
38
+ style={{
39
+ backgroundColor: theme.inputBg,
40
+ color: theme.newChatFormTexts,
41
+ }}
42
+ >
43
+ <option value='' disabled hidden>
44
+ {placeholder}
45
+ </option>
46
+ {options.map((motivo) => (
47
+ <option key={motivo.value} value={motivo.value}>
48
+ {motivo.label}
49
+ </option>
50
+ ))}
51
+ </select>
52
+ </div>
53
+ )
54
+ }
55
+
56
+ export default SelectNew