@bytexbyte/nxtlinq-ai-agent-sdk 1.6.0 → 1.6.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.
- package/dist/components/context/ChatBotContext.d.ts.map +1 -1
- package/dist/components/context/ChatBotContext.js +8 -4
- package/dist/components/ui/BerifyMeModal.d.ts +1 -0
- package/dist/components/ui/BerifyMeModal.d.ts.map +1 -1
- package/dist/components/ui/BerifyMeModal.js +8 -10
- package/dist/components/ui/ChatBotUI.d.ts +1 -0
- package/dist/components/ui/ChatBotUI.d.ts.map +1 -1
- package/dist/components/ui/ChatBotUI.js +58 -213
- package/dist/components/ui/MessageInput.d.ts.map +1 -1
- package/dist/components/ui/MessageInput.js +41 -38
- package/dist/components/ui/MessageList.d.ts +1 -0
- package/dist/components/ui/MessageList.d.ts.map +1 -1
- package/dist/components/ui/MessageList.js +16 -79
- package/dist/components/ui/ModelSelector.d.ts +1 -0
- package/dist/components/ui/ModelSelector.d.ts.map +1 -1
- package/dist/components/ui/ModelSelector.js +51 -45
- package/dist/components/ui/NotificationModal.d.ts +1 -0
- package/dist/components/ui/NotificationModal.d.ts.map +1 -1
- package/dist/components/ui/NotificationModal.js +48 -74
- package/dist/components/ui/PermissionForm.d.ts +1 -1
- package/dist/components/ui/PermissionForm.d.ts.map +1 -1
- package/dist/components/ui/PermissionForm.js +296 -293
- package/dist/components/ui/PresetMessages.d.ts +1 -0
- package/dist/components/ui/PresetMessages.d.ts.map +1 -1
- package/dist/components/ui/PresetMessages.js +26 -27
- package/dist/components/ui/styles/isolatedStyles.d.ts +34 -0
- package/dist/components/ui/styles/isolatedStyles.d.ts.map +1 -0
- package/dist/components/ui/styles/isolatedStyles.js +449 -0
- package/package.json +1 -1
- package/umd/nxtlinq-ai-agent.umd.js +882 -19
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
2
3
|
import * as React from 'react';
|
|
4
|
+
import { css } from '@emotion/react';
|
|
3
5
|
import { useChatBot } from '../context/ChatBotContext';
|
|
4
|
-
|
|
6
|
+
import { actionButton } from './styles/isolatedStyles';
|
|
7
|
+
export const PermissionForm = ({ onClose }) => {
|
|
5
8
|
const { hitAddress, permissions, setPermissions, setIsDisabled, onSave, onConnectWallet, onSignIn, isNeedSignInWithWallet, walletInfo, onVerifyWallet, serviceId, nxtlinqApi, permissionGroup, isAITLoading, isWalletLoading = false, refreshAIT, props } = useChatBot();
|
|
6
9
|
const [availablePermissions, setAvailablePermissions] = React.useState([]);
|
|
7
10
|
const [isSaving, setIsSaving] = React.useState(false);
|
|
@@ -80,253 +83,257 @@ export const PermissionForm = ({ onClose, onOpen }) => {
|
|
|
80
83
|
};
|
|
81
84
|
// Show loading state while checking wallet status
|
|
82
85
|
if (isWalletLoading) {
|
|
83
|
-
return (_jsxs("div", {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
86
|
+
return (_jsxs("div", { css: css `
|
|
87
|
+
background-color: white !important;
|
|
88
|
+
padding: 24px !important;
|
|
89
|
+
border-radius: 12px !important;
|
|
90
|
+
width: 480px !important;
|
|
91
|
+
max-width: 90% !important;
|
|
92
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
|
|
93
|
+
`, children: [_jsxs("div", { css: css `
|
|
94
|
+
display: flex !important;
|
|
95
|
+
justify-content: space-between !important;
|
|
96
|
+
align-items: center !important;
|
|
97
|
+
margin-bottom: 24px !important;
|
|
98
|
+
`, children: [_jsx("h3", { css: css `
|
|
99
|
+
margin: 0 !important;
|
|
100
|
+
font-size: 20px !important;
|
|
101
|
+
font-weight: 600 !important;
|
|
102
|
+
color: #1a1a1a !important;
|
|
103
|
+
`, children: "AIT Settings" }), _jsx("button", { onClick: onClose, css: css `
|
|
104
|
+
background: none !important;
|
|
105
|
+
border: none !important;
|
|
106
|
+
font-size: 24px !important;
|
|
107
|
+
cursor: pointer !important;
|
|
108
|
+
color: #666 !important;
|
|
109
|
+
padding: 4px !important;
|
|
110
|
+
display: flex !important;
|
|
111
|
+
align-items: center !important;
|
|
112
|
+
justify-content: center !important;
|
|
113
|
+
|
|
114
|
+
&:hover {
|
|
115
|
+
background-color: #f0f0f0 !important;
|
|
116
|
+
color: #333 !important;
|
|
117
|
+
}
|
|
118
|
+
`, children: "\u00D7" })] }), _jsxs("div", { css: css `
|
|
119
|
+
text-align: center !important;
|
|
120
|
+
padding: 32px 0 !important;
|
|
121
|
+
`, children: [_jsx("div", { css: css `
|
|
122
|
+
width: 64px !important;
|
|
123
|
+
height: 64px !important;
|
|
124
|
+
margin: 0 auto 16px !important;
|
|
125
|
+
background-color: #f5f5f5 !important;
|
|
126
|
+
border-radius: 50% !important;
|
|
127
|
+
display: flex !important;
|
|
128
|
+
align-items: center !important;
|
|
129
|
+
justify-content: center !important;
|
|
130
|
+
`, children: _jsx("div", { css: css `
|
|
131
|
+
width: 32px !important;
|
|
132
|
+
height: 32px !important;
|
|
133
|
+
border: 3px solid #e3e3e3 !important;
|
|
134
|
+
border-top: 3px solid #007bff !important;
|
|
135
|
+
border-radius: 50% !important;
|
|
136
|
+
animation: spin 1s linear infinite !important;
|
|
137
|
+
` }) }), _jsx("p", { css: css `
|
|
138
|
+
margin-bottom: 24px !important;
|
|
139
|
+
font-size: 16px !important;
|
|
140
|
+
color: #666 !important;
|
|
141
|
+
`, children: "Checking wallet status..." })] }), _jsx("style", { children: `
|
|
131
142
|
@keyframes spin {
|
|
132
143
|
0% { transform: rotate(0deg); }
|
|
133
144
|
100% { transform: rotate(360deg); }
|
|
134
145
|
}
|
|
135
146
|
` })] }));
|
|
136
147
|
}
|
|
137
|
-
return (_jsxs("div", {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
148
|
+
return (_jsxs("div", { css: css `
|
|
149
|
+
background-color: white !important;
|
|
150
|
+
padding: 24px !important;
|
|
151
|
+
border-radius: 12px !important;
|
|
152
|
+
width: 480px !important;
|
|
153
|
+
max-width: 90% !important;
|
|
154
|
+
max-height: 90vh !important;
|
|
155
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
|
|
156
|
+
display: flex !important;
|
|
157
|
+
flex-direction: column !important;
|
|
158
|
+
overflow: hidden !important;
|
|
159
|
+
`, children: [_jsxs("div", { css: css `
|
|
160
|
+
display: flex !important;
|
|
161
|
+
justify-content: space-between !important;
|
|
162
|
+
align-items: center !important;
|
|
163
|
+
margin-bottom: 24px !important;
|
|
164
|
+
`, children: [_jsx("h3", { css: css `
|
|
165
|
+
margin: 0 !important;
|
|
166
|
+
font-size: 20px !important;
|
|
167
|
+
font-weight: 600 !important;
|
|
168
|
+
color: #1a1a1a !important;
|
|
169
|
+
`, children: "AIT Settings" }), _jsx("button", { onClick: onClose, css: css `
|
|
170
|
+
background: none !important;
|
|
171
|
+
border: none !important;
|
|
172
|
+
font-size: 24px !important;
|
|
173
|
+
cursor: pointer !important;
|
|
174
|
+
color: #666 !important;
|
|
175
|
+
padding: 8px !important;
|
|
176
|
+
display: flex !important;
|
|
177
|
+
align-items: center !important;
|
|
178
|
+
justify-content: center !important;
|
|
179
|
+
border-radius: 4px !important;
|
|
180
|
+
transition: background-color 0.2s !important;
|
|
181
|
+
min-width: 32px !important;
|
|
182
|
+
min-height: 32px !important;
|
|
183
|
+
|
|
184
|
+
&:hover {
|
|
185
|
+
background-color: #f0f0f0 !important;
|
|
186
|
+
color: #333 !important;
|
|
187
|
+
}
|
|
188
|
+
`, title: "Close", children: "\u00D7" })] }), !hitAddress ? (_jsxs("div", { css: css `
|
|
189
|
+
text-align: center !important;
|
|
190
|
+
padding: 32px 0 !important;
|
|
191
|
+
`, children: [_jsx("div", { css: css `
|
|
192
|
+
width: 64px !important;
|
|
193
|
+
height: 64px !important;
|
|
194
|
+
margin: 0 auto 16px !important;
|
|
195
|
+
background-color: #f5f5f5 !important;
|
|
196
|
+
border-radius: 50% !important;
|
|
197
|
+
display: flex !important;
|
|
198
|
+
align-items: center !important;
|
|
199
|
+
justify-content: center !important;
|
|
200
|
+
`, children: _jsx("span", { css: css `font-size: 32px !important;`, children: "\uD83D\uDC5B" }) }), _jsx("p", { css: css `
|
|
201
|
+
margin-bottom: 24px !important;
|
|
202
|
+
font-size: 16px !important;
|
|
203
|
+
color: #666 !important;
|
|
204
|
+
`, children: "Please connect your wallet first" }), _jsx("button", { onClick: onConnectWallet, disabled: Boolean(hitAddress), css: css `
|
|
205
|
+
${actionButton}
|
|
206
|
+
padding: 12px 24px !important;
|
|
207
|
+
background-color: ${Boolean(hitAddress) ? '#28a745' : '#007bff'} !important;
|
|
208
|
+
border-radius: 8px !important;
|
|
209
|
+
font-size: 16px !important;
|
|
210
|
+
opacity: ${Boolean(hitAddress) ? 0.8 : 1} !important;
|
|
211
|
+
|
|
212
|
+
&:disabled {
|
|
213
|
+
cursor: not-allowed !important;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&:hover:not(:disabled) {
|
|
217
|
+
background-color: #0056b3 !important;
|
|
218
|
+
}
|
|
219
|
+
`, children: Boolean(hitAddress) ? 'Connected' : 'Connect Wallet' })] })) : isNeedSignInWithWallet ? (_jsxs("div", { css: css `
|
|
220
|
+
text-align: center !important;
|
|
221
|
+
padding: 32px 0 !important;
|
|
222
|
+
`, children: [_jsxs("div", { css: css `margin-bottom: 24px !important;`, children: [_jsx("h4", { css: css `
|
|
223
|
+
margin-bottom: 12px !important;
|
|
224
|
+
font-size: 16px !important;
|
|
225
|
+
color: #666 !important;
|
|
226
|
+
`, children: "Connected Wallet" }), _jsx("p", { css: css `
|
|
227
|
+
word-break: break-all !important;
|
|
228
|
+
background-color: #f8f9fa !important;
|
|
229
|
+
padding: 12px !important;
|
|
230
|
+
border-radius: 8px !important;
|
|
231
|
+
font-size: 14px !important;
|
|
232
|
+
color: #333 !important;
|
|
233
|
+
border: 1px solid #e9ecef !important;
|
|
234
|
+
`, children: hitAddress })] }), _jsx("p", { css: css `
|
|
235
|
+
margin-bottom: 24px !important;
|
|
236
|
+
font-size: 16px !important;
|
|
237
|
+
color: #666 !important;
|
|
238
|
+
`, children: "Please sign in to continue" }), _jsx("button", { onClick: onSignIn, disabled: !isNeedSignInWithWallet, css: css `
|
|
239
|
+
${actionButton}
|
|
240
|
+
padding: 12px 24px !important;
|
|
241
|
+
background-color: ${!isNeedSignInWithWallet ? '#28a745' : '#007bff'} !important;
|
|
242
|
+
border-radius: 8px !important;
|
|
243
|
+
font-size: 16px !important;
|
|
244
|
+
opacity: ${!isNeedSignInWithWallet ? 0.8 : 1} !important;
|
|
245
|
+
|
|
246
|
+
&:disabled {
|
|
247
|
+
cursor: not-allowed !important;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
&:hover:not(:disabled) {
|
|
251
|
+
background-color: #0056b3 !important;
|
|
252
|
+
}
|
|
253
|
+
`, children: !isNeedSignInWithWallet ? 'Signed In' : 'Sign In' })] })) : shouldShowVerificationPrompt ? (_jsxs("div", { css: css `
|
|
254
|
+
text-align: center !important;
|
|
255
|
+
padding: 32px 0 !important;
|
|
256
|
+
`, children: [_jsxs("div", { css: css `margin-bottom: 24px !important;`, children: [_jsx("h4", { css: css `
|
|
257
|
+
margin-bottom: 12px !important;
|
|
258
|
+
font-size: 16px !important;
|
|
259
|
+
color: #666 !important;
|
|
260
|
+
`, children: "Connected Wallet" }), _jsx("p", { css: css `
|
|
261
|
+
word-break: break-all !important;
|
|
262
|
+
background-color: #f8f9fa !important;
|
|
263
|
+
padding: 12px !important;
|
|
264
|
+
border-radius: 8px !important;
|
|
265
|
+
font-size: 14px !important;
|
|
266
|
+
color: #333 !important;
|
|
267
|
+
border: 1px solid #e9ecef !important;
|
|
268
|
+
`, children: hitAddress })] }), _jsx("p", { css: css `
|
|
269
|
+
margin-bottom: 24px !important;
|
|
270
|
+
font-size: 16px !important;
|
|
271
|
+
color: #666 !important;
|
|
272
|
+
`, children: isWalletVerified && !isWalletVerifiedWithBerifyme
|
|
262
273
|
? 'Your wallet is verified with custom method, but Berify.me verification is required to continue.'
|
|
263
|
-
: 'Please verify your wallet with Berify.me to continue' }), _jsx("button", { onClick: () => onVerifyWallet('berifyme'),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
if (!isAITLoading) {
|
|
327
|
-
e.currentTarget.style.backgroundColor = 'transparent';
|
|
328
|
-
}
|
|
329
|
-
}, children: [_jsx("input", { type: "checkbox", checked: tempPermissions.includes(permission.label), onChange: () => {
|
|
274
|
+
: 'Please verify your wallet with Berify.me to continue' }), _jsx("button", { onClick: () => onVerifyWallet('berifyme'), css: css `
|
|
275
|
+
${actionButton}
|
|
276
|
+
padding: 12px 24px !important;
|
|
277
|
+
background-color: #007bff !important;
|
|
278
|
+
border-radius: 8px !important;
|
|
279
|
+
font-size: 16px !important;
|
|
280
|
+
|
|
281
|
+
&:hover {
|
|
282
|
+
background-color: #0056b3 !important;
|
|
283
|
+
}
|
|
284
|
+
`, children: "Verify your wallet" })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { css: css `margin-bottom: 24px !important;`, children: [_jsx("h4", { css: css `
|
|
285
|
+
margin-bottom: 12px !important;
|
|
286
|
+
font-size: 16px !important;
|
|
287
|
+
color: #666 !important;
|
|
288
|
+
`, children: "Connected Wallet" }), _jsx("p", { css: css `
|
|
289
|
+
word-break: break-all !important;
|
|
290
|
+
background-color: #f8f9fa !important;
|
|
291
|
+
padding: 12px !important;
|
|
292
|
+
border-radius: 8px !important;
|
|
293
|
+
font-size: 14px !important;
|
|
294
|
+
color: #333 !important;
|
|
295
|
+
border: 1px solid #e9ecef !important;
|
|
296
|
+
`, children: hitAddress })] }), _jsxs("div", { css: css `
|
|
297
|
+
margin-bottom: 24px !important;
|
|
298
|
+
flex: 1 !important;
|
|
299
|
+
display: flex !important;
|
|
300
|
+
flex-direction: column !important;
|
|
301
|
+
min-height: 0 !important;
|
|
302
|
+
`, children: [_jsx("h4", { css: css `
|
|
303
|
+
margin-bottom: 12px !important;
|
|
304
|
+
font-size: 16px !important;
|
|
305
|
+
color: #666 !important;
|
|
306
|
+
flex-shrink: 0 !important;
|
|
307
|
+
`, children: "Permissions" }), isAITLoading ? (_jsx("div", { css: css `
|
|
308
|
+
background-color: #f8f9fa !important;
|
|
309
|
+
padding: 16px !important;
|
|
310
|
+
border-radius: 8px !important;
|
|
311
|
+
border: 1px solid #e9ecef !important;
|
|
312
|
+
text-align: center !important;
|
|
313
|
+
color: #666 !important;
|
|
314
|
+
`, children: "Loading permissions..." })) : (_jsx("div", { css: css `
|
|
315
|
+
background-color: #f8f9fa !important;
|
|
316
|
+
padding: 16px !important;
|
|
317
|
+
border-radius: 8px !important;
|
|
318
|
+
border: 1px solid #e9ecef !important;
|
|
319
|
+
flex: 1 !important;
|
|
320
|
+
overflow-y: auto !important;
|
|
321
|
+
overflow-x: hidden !important;
|
|
322
|
+
min-height: 0 !important;
|
|
323
|
+
`, children: availablePermissions.map((permission) => (_jsx("div", { css: css `margin-bottom: 12px !important;`, children: _jsxs("label", { css: css `
|
|
324
|
+
display: flex !important;
|
|
325
|
+
align-items: center !important;
|
|
326
|
+
gap: 12px !important;
|
|
327
|
+
cursor: ${isAITLoading ? 'not-allowed' : 'pointer'} !important;
|
|
328
|
+
padding: 8px !important;
|
|
329
|
+
border-radius: 6px !important;
|
|
330
|
+
transition: background-color 0.2s !important;
|
|
331
|
+
opacity: ${isAITLoading ? 0.6 : 1} !important;
|
|
332
|
+
|
|
333
|
+
&:hover {
|
|
334
|
+
background-color: ${!isAITLoading ? '#e9ecef' : 'transparent'} !important;
|
|
335
|
+
}
|
|
336
|
+
`, children: [_jsx("input", { type: "checkbox", checked: tempPermissions.includes(permission.label), onChange: () => {
|
|
330
337
|
if (!isAITLoading) {
|
|
331
338
|
const newPermissions = tempPermissions.includes(permission.label)
|
|
332
339
|
? tempPermissions.filter(p => p !== permission.label)
|
|
@@ -334,55 +341,51 @@ export const PermissionForm = ({ onClose, onOpen }) => {
|
|
|
334
341
|
setTempPermissions(newPermissions);
|
|
335
342
|
setIsDisabled(false);
|
|
336
343
|
}
|
|
337
|
-
}, disabled: isAITLoading,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
if (hasPermissionChanges() && !isSaving && !isAITLoading) {
|
|
385
|
-
e.currentTarget.style.backgroundColor = '#007bff';
|
|
386
|
-
}
|
|
387
|
-
}, children: isSaving ? 'Saving...' : 'Save' })] })] }))] }));
|
|
344
|
+
}, disabled: isAITLoading, css: css `
|
|
345
|
+
margin: 0 !important;
|
|
346
|
+
width: 18px !important;
|
|
347
|
+
height: 18px !important;
|
|
348
|
+
cursor: ${isAITLoading ? 'not-allowed' : 'pointer'} !important;
|
|
349
|
+
` }), _jsx("span", { css: css `
|
|
350
|
+
font-size: 14px !important;
|
|
351
|
+
color: #333 !important;
|
|
352
|
+
`, children: permission.label })] }) }, permission.id))) }))] }), _jsxs("div", { css: css `
|
|
353
|
+
display: flex !important;
|
|
354
|
+
justify-content: flex-end !important;
|
|
355
|
+
gap: 12px !important;
|
|
356
|
+
border-top: 1px solid #e9ecef !important;
|
|
357
|
+
padding-top: 24px !important;
|
|
358
|
+
flex-shrink: 0 !important;
|
|
359
|
+
margin-top: auto !important;
|
|
360
|
+
`, children: [_jsx("button", { onClick: handleCancel, css: css `
|
|
361
|
+
padding: 10px 20px !important;
|
|
362
|
+
background-color: #f8f9fa !important;
|
|
363
|
+
color: #666 !important;
|
|
364
|
+
border: 1px solid #dee2e6 !important;
|
|
365
|
+
border-radius: 8px !important;
|
|
366
|
+
cursor: pointer !important;
|
|
367
|
+
font-size: 14px !important;
|
|
368
|
+
font-weight: 500 !important;
|
|
369
|
+
transition: all 0.2s !important;
|
|
370
|
+
|
|
371
|
+
&:hover {
|
|
372
|
+
background-color: #e9ecef !important;
|
|
373
|
+
border-color: #ced4da !important;
|
|
374
|
+
}
|
|
375
|
+
`, children: "Cancel" }), _jsx("button", { onClick: handleSave, disabled: !hasPermissionChanges() || isSaving || isAITLoading, css: css `
|
|
376
|
+
${actionButton}
|
|
377
|
+
padding: 10px 20px !important;
|
|
378
|
+
background-color: ${!hasPermissionChanges() || isSaving || isAITLoading ? '#e9ecef' : '#007bff'} !important;
|
|
379
|
+
color: ${!hasPermissionChanges() || isSaving || isAITLoading ? '#6c757d' : 'white'} !important;
|
|
380
|
+
border-radius: 8px !important;
|
|
381
|
+
font-size: 14px !important;
|
|
382
|
+
|
|
383
|
+
&:disabled {
|
|
384
|
+
cursor: not-allowed !important;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
&:hover:not(:disabled) {
|
|
388
|
+
background-color: #0056b3 !important;
|
|
389
|
+
}
|
|
390
|
+
`, children: isSaving ? 'Saving...' : 'Save' })] })] }))] }));
|
|
388
391
|
};
|