@iblai/iblai-js 2.62.2 → 2.62.3
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/data-layer/playwright/index.d.ts +1 -1
- package/dist/data-layer/playwright/spend-limits-helpers.d.ts +80 -2
- package/dist/playwright/index.cjs +210 -2
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.d.ts +81 -3
- package/dist/playwright/index.esm.js +197 -3
- package/dist/playwright/index.esm.js.map +1 -1
- package/dist/playwright/playwright/index.d.ts +1 -1
- package/dist/playwright/playwright/spend-limits-helpers.d.ts +80 -2
- package/dist/security/playwright/index.d.ts +1 -1
- package/dist/security/playwright/spend-limits-helpers.d.ts +80 -2
- package/dist/web-containers/playwright/index.d.ts +1 -1
- package/dist/web-containers/playwright/spend-limits-helpers.d.ts +80 -2
- package/dist/web-containers/source/agent-limits-section.js +3 -5
- package/dist/web-containers/source/agent-limits-section.js.map +1 -1
- package/dist/web-containers/source/billing.js +9 -3
- package/dist/web-containers/source/billing.js.map +1 -1
- package/dist/web-containers/source/chat/index.js +39 -11
- package/dist/web-containers/source/chat/index.js.map +1 -1
- package/dist/web-containers/source/chat-input-form.js +2 -2
- package/dist/web-containers/source/chat-input-form.js.map +1 -1
- package/dist/web-containers/source/components/chat/index.js +39 -11
- package/dist/web-containers/source/components/chat/index.js.map +1 -1
- package/dist/web-containers/source/components/chat-input-form.js +2 -2
- package/dist/web-containers/source/components/chat-input-form.js.map +1 -1
- package/dist/web-containers/source/components/profile/billing.js +9 -3
- package/dist/web-containers/source/components/profile/billing.js.map +1 -1
- package/dist/web-containers/source/components/spend-caps/agent-limits-section.js +3 -5
- package/dist/web-containers/source/components/spend-caps/agent-limits-section.js.map +1 -1
- package/dist/web-containers/source/components/spend-caps/labels.js +74 -0
- package/dist/web-containers/source/components/spend-caps/labels.js.map +1 -1
- package/dist/web-containers/source/components/spend-caps/new-user-default-section.js +78 -0
- package/dist/web-containers/source/components/spend-caps/new-user-default-section.js.map +1 -0
- package/dist/web-containers/source/components/spend-caps/row-icon-action.js +16 -0
- package/dist/web-containers/source/components/spend-caps/row-icon-action.js.map +1 -0
- package/dist/web-containers/source/components/spend-caps/spend-cap-fields.js +23 -0
- package/dist/web-containers/source/components/spend-caps/spend-cap-fields.js.map +1 -0
- package/dist/web-containers/source/components/spend-caps/spend-cap-form.js +21 -23
- package/dist/web-containers/source/components/spend-caps/spend-cap-form.js.map +1 -1
- package/dist/web-containers/source/components/spend-caps/spend-cap-usage.js +1 -0
- package/dist/web-containers/source/components/spend-caps/spend-cap-usage.js.map +1 -1
- package/dist/web-containers/source/components/spend-caps/use-platform-user-options.js +39 -0
- package/dist/web-containers/source/components/spend-caps/use-platform-user-options.js.map +1 -0
- package/dist/web-containers/source/components/spend-caps/use-spend-cap-status.js +23 -0
- package/dist/web-containers/source/components/spend-caps/use-spend-cap-status.js.map +1 -0
- package/dist/web-containers/source/components/spend-caps/use-spend-caps.js +1 -11
- package/dist/web-containers/source/components/spend-caps/use-spend-caps.js.map +1 -1
- package/dist/web-containers/source/components/spend-caps/user-cap-modal.js +8 -32
- package/dist/web-containers/source/components/spend-caps/user-cap-modal.js.map +1 -1
- package/dist/web-containers/source/components/spend-caps/user-limits-section.js +117 -0
- package/dist/web-containers/source/components/spend-caps/user-limits-section.js.map +1 -0
- package/dist/web-containers/source/components/spend-caps/utils.js +14 -1
- package/dist/web-containers/source/components/spend-caps/utils.js.map +1 -1
- package/dist/web-containers/source/en.json.js +44 -3
- package/dist/web-containers/source/en.json.js.map +1 -1
- package/dist/web-containers/source/es.json.js +44 -3
- package/dist/web-containers/source/es.json.js.map +1 -1
- package/dist/web-containers/source/fr.json.js +44 -3
- package/dist/web-containers/source/fr.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/en.json.js +44 -3
- package/dist/web-containers/source/i18n/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/es.json.js +44 -3
- package/dist/web-containers/source/i18n/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/fr.json.js +44 -3
- package/dist/web-containers/source/i18n/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/zh.json.js +44 -3
- package/dist/web-containers/source/i18n/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/messages/en.json.js +44 -3
- package/dist/web-containers/source/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/messages/es.json.js +44 -3
- package/dist/web-containers/source/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/messages/fr.json.js +44 -3
- package/dist/web-containers/source/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/messages/zh.json.js +44 -3
- package/dist/web-containers/source/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/new-user-default-section.js +78 -0
- package/dist/web-containers/source/new-user-default-section.js.map +1 -0
- package/dist/web-containers/source/profile/billing.js +9 -3
- package/dist/web-containers/source/profile/billing.js.map +1 -1
- package/dist/web-containers/source/row-icon-action.js +16 -0
- package/dist/web-containers/source/row-icon-action.js.map +1 -0
- package/dist/web-containers/source/spend-cap-fields.js +23 -0
- package/dist/web-containers/source/spend-cap-fields.js.map +1 -0
- package/dist/web-containers/source/spend-cap-form.js +21 -23
- package/dist/web-containers/source/spend-cap-form.js.map +1 -1
- package/dist/web-containers/source/spend-cap-usage.js +1 -0
- package/dist/web-containers/source/spend-cap-usage.js.map +1 -1
- package/dist/web-containers/source/spend-caps/agent-limits-section.js +3 -5
- package/dist/web-containers/source/spend-caps/agent-limits-section.js.map +1 -1
- package/dist/web-containers/source/spend-caps/labels.js +74 -0
- package/dist/web-containers/source/spend-caps/labels.js.map +1 -1
- package/dist/web-containers/source/spend-caps/new-user-default-section.js +78 -0
- package/dist/web-containers/source/spend-caps/new-user-default-section.js.map +1 -0
- package/dist/web-containers/source/spend-caps/row-icon-action.js +16 -0
- package/dist/web-containers/source/spend-caps/row-icon-action.js.map +1 -0
- package/dist/web-containers/source/spend-caps/spend-cap-fields.js +23 -0
- package/dist/web-containers/source/spend-caps/spend-cap-fields.js.map +1 -0
- package/dist/web-containers/source/spend-caps/spend-cap-form.js +21 -23
- package/dist/web-containers/source/spend-caps/spend-cap-form.js.map +1 -1
- package/dist/web-containers/source/spend-caps/spend-cap-usage.js +1 -0
- package/dist/web-containers/source/spend-caps/spend-cap-usage.js.map +1 -1
- package/dist/web-containers/source/spend-caps/use-platform-user-options.js +39 -0
- package/dist/web-containers/source/spend-caps/use-platform-user-options.js.map +1 -0
- package/dist/web-containers/source/spend-caps/use-spend-cap-status.js +23 -0
- package/dist/web-containers/source/spend-caps/use-spend-cap-status.js.map +1 -0
- package/dist/web-containers/source/spend-caps/use-spend-caps.js +1 -11
- package/dist/web-containers/source/spend-caps/use-spend-caps.js.map +1 -1
- package/dist/web-containers/source/spend-caps/user-cap-modal.js +8 -32
- package/dist/web-containers/source/spend-caps/user-cap-modal.js.map +1 -1
- package/dist/web-containers/source/spend-caps/user-limits-section.js +117 -0
- package/dist/web-containers/source/spend-caps/user-limits-section.js.map +1 -0
- package/dist/web-containers/source/spend-caps/utils.js +14 -1
- package/dist/web-containers/source/spend-caps/utils.js.map +1 -1
- package/dist/web-containers/source/tsconfig.build.tsbuildinfo +1 -1
- package/dist/web-containers/source/use-platform-user-options.js +39 -0
- package/dist/web-containers/source/use-platform-user-options.js.map +1 -0
- package/dist/web-containers/source/use-spend-cap-status.js +23 -0
- package/dist/web-containers/source/use-spend-cap-status.js.map +1 -0
- package/dist/web-containers/source/use-spend-caps.js +1 -11
- package/dist/web-containers/source/use-spend-caps.js.map +1 -1
- package/dist/web-containers/source/user-cap-modal.js +8 -32
- package/dist/web-containers/source/user-cap-modal.js.map +1 -1
- package/dist/web-containers/source/user-limits-section.js +117 -0
- package/dist/web-containers/source/user-limits-section.js.map +1 -0
- package/dist/web-containers/source/web-containers/tsconfig.build.tsbuildinfo +1 -1
- package/dist/web-containers/source/zh.json.js +44 -3
- package/dist/web-containers/source/zh.json.js.map +1 -1
- package/dist/web-utils/playwright/index.d.ts +1 -1
- package/dist/web-utils/playwright/spend-limits-helpers.d.ts +80 -2
- package/package.json +5 -5
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useDebounce as a } from '../../node_modules/.pnpm/use-debounce@10.0.4_react@19.1.0/node_modules/use-debounce/dist/index.module.js';
|
|
2
|
+
import { usePlatformUsersQuery } from '@iblai/data-layer';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Options for a platform-user picker, searched tenant-wide once the
|
|
6
|
+
* debounced term reaches two characters. Deliberately email-only in the UI
|
|
7
|
+
* (no name/username noise); the cap API is still keyed by username, which
|
|
8
|
+
* rides along as the option value.
|
|
9
|
+
*/
|
|
10
|
+
function usePlatformUserOptions(tenantKey, searchTerm, { enabled = true } = {}) {
|
|
11
|
+
var _a;
|
|
12
|
+
const [debouncedSearch] = a(searchTerm, 300);
|
|
13
|
+
const query = debouncedSearch.trim();
|
|
14
|
+
const shouldSearch = Boolean(enabled && tenantKey && query.length >= 2);
|
|
15
|
+
const { data, isFetching } = usePlatformUsersQuery({
|
|
16
|
+
page: 1,
|
|
17
|
+
page_size: 20,
|
|
18
|
+
platform_key: tenantKey,
|
|
19
|
+
platform_org: tenantKey,
|
|
20
|
+
query,
|
|
21
|
+
return_policies: 'false',
|
|
22
|
+
}, { skip: !shouldSearch });
|
|
23
|
+
// The platform users endpoint returns either `results` or `results.data`
|
|
24
|
+
// depending on whether policies were requested.
|
|
25
|
+
const rawResults = data === null || data === void 0 ? void 0 : data.results;
|
|
26
|
+
const foundUsers = Array.isArray(rawResults)
|
|
27
|
+
? rawResults
|
|
28
|
+
: ((_a = rawResults === null || rawResults === void 0 ? void 0 : rawResults.data) !== null && _a !== void 0 ? _a : []);
|
|
29
|
+
const options = foundUsers
|
|
30
|
+
.filter((user) => Boolean(user.username) && Boolean(user.email))
|
|
31
|
+
.map((user) => ({
|
|
32
|
+
value: user.username,
|
|
33
|
+
label: user.email,
|
|
34
|
+
}));
|
|
35
|
+
return { options, isSearching: isFetching };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { usePlatformUserOptions };
|
|
39
|
+
//# sourceMappingURL=use-platform-user-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-platform-user-options.js","sources":["../../../../../../../src/components/spend-caps/use-platform-user-options.ts"],"sourcesContent":[null],"names":["useDebounce"],"mappings":";;;AAcA;;;;;AAKG;AACG,SAAU,sBAAsB,CACpC,SAAiB,EACjB,UAAkB,EAClB,EAAE,OAAO,GAAG,IAAI,EAAA,GAA4B,EAAE,EAAA;;IAE9C,MAAM,CAAC,eAAe,CAAC,GAAGA,CAAW,CAAC,UAAU,EAAE,GAAG,CAAC;AACtD,IAAA,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,EAAE;AACpC,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,IAAI,SAAS,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;AACvE,IAAA,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,qBAAqB,CAChD;AACE,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,SAAS,EAAE,EAAE;AACb,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,YAAY,EAAE,SAAS;QACvB,KAAK;AACL,QAAA,eAAe,EAAE,OAAO;AACzB,KAAA,EACD,EAAE,IAAI,EAAE,CAAC,YAAY,EAAE,CACxB;;;IAID,MAAM,UAAU,GACd,IACD,KAAA,IAAA,IADC,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CACH,OAAO;AACV,IAAA,MAAM,UAAU,GAAyB,KAAK,CAAC,OAAO,CAAC,UAAU;AAC/D,UAAE;AACF,WAAG,CAAA,EAAA,GAAA,UAAU,KAAA,IAAA,IAAV,UAAU,KAAA,MAAA,GAAA,MAAA,GAAV,UAAU,CAAE,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAyB;AACnC,SAAA,MAAM,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;AAC9D,SAAA,GAAG,CAAC,CAAC,IAAI,MAAM;QACd,KAAK,EAAE,IAAI,CAAC,QAAkB;QAC9B,KAAK,EAAE,IAAI,CAAC,KAAe;AAC5B,KAAA,CAAC,CAAC;AAEL,IAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE;AAC7C;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { useGetSpendCapStatusQuery } from '@iblai/data-layer';
|
|
3
|
+
|
|
4
|
+
/** How often the chat re-reads the status so a warning appears mid-conversation. */
|
|
5
|
+
const SPEND_CAP_STATUS_POLL_MS = 60000;
|
|
6
|
+
/**
|
|
7
|
+
* Learner-safe spend-cap status for the chat (zones and percentages only,
|
|
8
|
+
* never dollars), polled while the chat is open. `SpendCapUsage` reads the
|
|
9
|
+
* same cache entry, so rendering it beside this hook costs no extra request.
|
|
10
|
+
*/
|
|
11
|
+
function useSpendCapStatus({ tenantKey, userId, mentorId, enabled = true, }) {
|
|
12
|
+
const skip = !enabled || !tenantKey || !userId;
|
|
13
|
+
const { data, refetch } = useGetSpendCapStatusQuery({ org: tenantKey, userId, mentor: mentorId }, { skip, pollingInterval: skip ? 0 : SPEND_CAP_STATUS_POLL_MS, refetchOnMountOrArgChange: true });
|
|
14
|
+
// RTK throws on refetching a query that never started (the skipped case).
|
|
15
|
+
const safeRefetch = React__default.useCallback(() => {
|
|
16
|
+
if (!skip)
|
|
17
|
+
void refetch();
|
|
18
|
+
}, [skip, refetch]);
|
|
19
|
+
return { summary: data, blocked: Boolean(data === null || data === void 0 ? void 0 : data.blocked), refetch: safeRefetch };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { SPEND_CAP_STATUS_POLL_MS, useSpendCapStatus };
|
|
23
|
+
//# sourceMappingURL=use-spend-cap-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-spend-cap-status.js","sources":["../../../../../../../src/components/spend-caps/use-spend-cap-status.ts"],"sourcesContent":[null],"names":["React"],"mappings":";;;AAKA;AACO,MAAM,wBAAwB,GAAG;AAoBxC;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,EAChC,SAAS,EACT,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,IAAI,GACW,EAAA;IACzB,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM;AAC9C,IAAA,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,yBAAyB,CACjD,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAC5C,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,GAAG,CAAC,GAAG,wBAAwB,EAAE,yBAAyB,EAAE,IAAI,EAAE,CAChG;;AAGD,IAAA,MAAM,WAAW,GAAGA,cAAK,CAAC,WAAW,CAAC,MAAK;AACzC,QAAA,IAAI,CAAC,IAAI;YAAE,KAAK,OAAO,EAAE;AAC3B,IAAA,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE;AACjF;;;;"}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { toast } from 'sonner';
|
|
2
2
|
import { useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation } from '@iblai/data-layer';
|
|
3
|
+
import { errorStatus, errorDetail } from './utils.js';
|
|
3
4
|
|
|
4
|
-
function errorStatus(error) {
|
|
5
|
-
return error === null || error === void 0 ? void 0 : error.status;
|
|
6
|
-
}
|
|
7
|
-
function errorDetail(error) {
|
|
8
|
-
const data = error === null || error === void 0 ? void 0 : error.data;
|
|
9
|
-
if (typeof (data === null || data === void 0 ? void 0 : data.detail) === 'string')
|
|
10
|
-
return data.detail;
|
|
11
|
-
if (typeof (data === null || data === void 0 ? void 0 : data.error) === 'string')
|
|
12
|
-
return data.error;
|
|
13
|
-
return '';
|
|
14
|
-
}
|
|
15
5
|
function useSpendCaps({ tenantKey, mentorId, labels }) {
|
|
16
6
|
const identityReady = Boolean(tenantKey && mentorId);
|
|
17
7
|
// 404 is the documented "no cap configured yet" state for the singleton
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-spend-caps.js","sources":["../../../../../../../src/components/spend-caps/use-spend-caps.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-spend-caps.js","sources":["../../../../../../../src/components/spend-caps/use-spend-caps.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAyBM,SAAU,YAAY,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAuB,EAAA;IAC/E,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAC;;;;AAKpD,IAAA,MAAM,EACJ,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,eAAe,GACzB,GAAG,wBAAwB,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,aAAa,EAAE,CAAC;AAEpF,IAAA,MAAM,EACJ,IAAI,EAAE,aAAa,EACnB,KAAK,EAA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SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,eAAe,CAAC;AAEzF,IAAA,MAAM,aAAa,GAAG,CAAC,QAA+B,KACpD,OAAO,CAAC,MAAM,eAAe,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC;IACzF,MAAM,eAAe,GAAG,MACtB,SAAS,CAAC,MAAM,eAAe,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC;AAEjF,IAAA,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,QAA+B,KACpE,OAAO,CACL,MAAM,aAAa,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAC9E,eAAe,CAChB;AACH,IAAA,MAAM,aAAa,GAAG,CAAC,QAAgB,KACrC,SAAS,CACP,MAAM,aAAa,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EACpE,eAAe,CAChB;IAEH,OAAO;QACL,QAAQ;QACR,iBAAiB;QACjB,gBAAgB;QAChB,YAAY;QACZ,cAAc;QACd,gBAAgB;QAChB,kBAAkB;QAElB,SAAS;QACT,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,eAAe;QACf,iBAAiB;QACjB,mBAAmB;QAEnB,QAAQ;QACR,iBAAiB;QACjB,gBAAgB;QAChB,WAAW;QACX,aAAa;QACb,eAAe;QACf,iBAAiB;KAClB;AACH;;;;"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { useDebounce as a } from '../../node_modules/.pnpm/use-debounce@10.0.4_react@19.1.0/node_modules/use-debounce/dist/index.module.js';
|
|
4
|
-
import { usePlatformUsersQuery } from '@iblai/data-layer';
|
|
5
3
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/dialog.js';
|
|
6
4
|
import { cn } from '../../lib/utils.js';
|
|
7
5
|
import { SearchSelect } from './search-select.js';
|
|
8
6
|
import { SpendCapForm } from './spend-cap-form.js';
|
|
7
|
+
import { usePlatformUserOptions } from './use-platform-user-options.js';
|
|
9
8
|
import { UserProfileLink } from '../profile/user-profile-link.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -14,8 +13,8 @@ import { UserProfileLink } from '../profile/user-profile-link.js';
|
|
|
14
13
|
* (no free-text usernames), edit mode goes straight to the form for the
|
|
15
14
|
* cap's user. The form's Cancel/Save footer acts as the dialog footer.
|
|
16
15
|
*/
|
|
17
|
-
function UserCapModal({ isOpen, onClose, cap, labels, tenantKey, isSaving, onSave }) {
|
|
18
|
-
var _a, _b, _c, _d
|
|
16
|
+
function UserCapModal({ isOpen, onClose, cap, labels, tenantKey, initialUser = null, isSaving, onSave, }) {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
19
18
|
const isEditing = Boolean(cap);
|
|
20
19
|
const [pickedUser, setPickedUser] = React__default.useState(null);
|
|
21
20
|
const [userSearch, setUserSearch] = React__default.useState('');
|
|
@@ -23,34 +22,11 @@ function UserCapModal({ isOpen, onClose, cap, labels, tenantKey, isSaving, onSav
|
|
|
23
22
|
React__default.useEffect(() => {
|
|
24
23
|
if (!isOpen)
|
|
25
24
|
return;
|
|
26
|
-
setPickedUser(
|
|
25
|
+
setPickedUser(initialUser);
|
|
27
26
|
setUserSearch('');
|
|
28
|
-
}, [isOpen, cap]);
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const { data: usersData, isFetching: isSearchingUsers } = usePlatformUsersQuery({
|
|
32
|
-
page: 1,
|
|
33
|
-
page_size: 20,
|
|
34
|
-
platform_key: tenantKey,
|
|
35
|
-
platform_org: tenantKey,
|
|
36
|
-
query: debouncedUserSearch.trim(),
|
|
37
|
-
return_policies: 'false',
|
|
38
|
-
}, { skip: !shouldSearchUsers });
|
|
39
|
-
// The platform users endpoint returns either `results` or `results.data`
|
|
40
|
-
// depending on whether policies were requested.
|
|
41
|
-
const rawResults = usersData === null || usersData === void 0 ? void 0 : usersData.results;
|
|
42
|
-
const foundUsers = Array.isArray(rawResults)
|
|
43
|
-
? rawResults
|
|
44
|
-
: ((_a = rawResults === null || rawResults === void 0 ? void 0 : rawResults.data) !== null && _a !== void 0 ? _a : []);
|
|
45
|
-
// Deliberately email-only in the UI (no name/username noise); the cap API
|
|
46
|
-
// is still keyed by username, which rides along as the option value.
|
|
47
|
-
const userOptions = foundUsers
|
|
48
|
-
.filter((user) => Boolean(user.username) && Boolean(user.email))
|
|
49
|
-
.map((user) => ({
|
|
50
|
-
value: user.username,
|
|
51
|
-
label: user.email,
|
|
52
|
-
}));
|
|
53
|
-
const username = isEditing ? ((_b = cap === null || cap === void 0 ? void 0 : cap.username) !== null && _b !== void 0 ? _b : '') : ((_c = pickedUser === null || pickedUser === void 0 ? void 0 : pickedUser.value) !== null && _c !== void 0 ? _c : '');
|
|
27
|
+
}, [isOpen, cap, initialUser]);
|
|
28
|
+
const { options: userOptions, isSearching: isSearchingUsers } = usePlatformUserOptions(tenantKey, userSearch, { enabled: isOpen && !isEditing });
|
|
29
|
+
const username = isEditing ? ((_a = cap === null || cap === void 0 ? void 0 : cap.username) !== null && _a !== void 0 ? _a : '') : ((_b = pickedUser === null || pickedUser === void 0 ? void 0 : pickedUser.value) !== null && _b !== void 0 ? _b : '');
|
|
54
30
|
const handleSave = async (formData) => {
|
|
55
31
|
if (!username)
|
|
56
32
|
return;
|
|
@@ -61,7 +37,7 @@ function UserCapModal({ isOpen, onClose, cap, labels, tenantKey, isSaving, onSav
|
|
|
61
37
|
return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent, { "aria-describedby": "user-cap-modal-description", "data-testid": "user-cap-modal", className: "flex max-h-[85vh] flex-col sm:max-w-xl", children: [jsx(DialogHeader, { className: "flex-shrink-0", children: jsx(DialogTitle, { className: "ibl-dialog-title", children: isEditing ? labels.users.editTitle : labels.users.addTitle }) }), jsxs("div", { className: cn('min-h-0 flex-1 space-y-4 overflow-y-auto',
|
|
62
38
|
// Reserve room for the search results dropdown while no user is
|
|
63
39
|
// picked yet — otherwise the scroll container clips it.
|
|
64
|
-
!isEditing && !pickedUser && 'min-h-[340px]'), id: "user-cap-modal-description", children: [isEditing ? (jsx("p", { className: "text-sm text-[#646464]", "data-testid": "user-cap-modal-username", children: jsx(UserProfileLink, { tenantKey: tenantKey, username: (
|
|
40
|
+
!isEditing && !pickedUser && 'min-h-[340px]'), id: "user-cap-modal-description", children: [isEditing ? (jsx("p", { className: "text-sm text-[#646464]", "data-testid": "user-cap-modal-username", children: jsx(UserProfileLink, { tenantKey: tenantKey, username: (_c = cap === null || cap === void 0 ? void 0 : cap.username) !== null && _c !== void 0 ? _c : '', display: (cap === null || cap === void 0 ? void 0 : cap.email) || ((_d = cap === null || cap === void 0 ? void 0 : cap.username) !== null && _d !== void 0 ? _d : ''), className: "inline", testId: "user-cap-modal-profile-link" }) })) : (jsx(SearchSelect, { labels: labels.users.picker, selected: pickedUser, onSelect: setPickedUser, onClear: () => setPickedUser(null), searchTerm: userSearch, onSearchTermChange: setUserSearch, options: userOptions, isLoading: isSearchingUsers, testId: "user-cap-modal-user-picker" })), Boolean(username) && (jsx(SpendCapForm, { labels: labels, cap: cap !== null && cap !== void 0 ? cap : undefined, isSaving: isSaving, isDeleting: false, onSave: handleSave, onCancel: onClose, testId: "user-cap-modal" }))] })] }) }));
|
|
65
41
|
}
|
|
66
42
|
|
|
67
43
|
export { UserCapModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-cap-modal.js","sources":["../../../../../../../src/components/spend-caps/user-cap-modal.tsx"],"sourcesContent":[null],"names":["React","
|
|
1
|
+
{"version":3,"file":"user-cap-modal.js","s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AAK,CAAA,EAAA,GAAA,GAAG,aAAH,GAAG,KAAA,MAAA,GAAA,MAAA,GAAH,GAAG,CAAE,QAAQ,mCAAI,EAAE,CAAC,EAC5C,SAAS,EAAC,QAAQ,EAClB,MAAM,EAAC,6BAA6B,GACpC,EAAA,CACA,KAEJA,GAAA,CAAC,YAAY,IACX,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAC3B,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,MAAM,aAAa,CAAC,IAAI,CAAC,EAClC,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,aAAa,EACjC,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAC,4BAA4B,GACnC,CACH,EACA,OAAO,CAAC,QAAQ,CAAC,KAChBA,GAAA,CAAC,YAAY,IACX,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,KAAA,IAAA,IAAH,GAAG,KAAA,MAAA,GAAH,GAAG,GAAI,SAAS,EACrB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,KAAK,EACjB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAC,gBAAgB,EAAA,CACvB,CACH,IACG,CAAA,EAAA,CACQ,EAAA,CACT;AAEb;;;;"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { toast } from 'sonner';
|
|
4
|
+
import { useListTenantUserSpendCapsQuery, useUpsertTenantUserSpendCapMutation, useDeleteTenantUserSpendCapMutation } from '@iblai/data-layer';
|
|
5
|
+
import { CustomSwitch } from '../modals/edit-mentor-modal/custom-switch.js';
|
|
6
|
+
import { UserProfileLink, UserProfileDialog } from '../profile/user-profile-link.js';
|
|
7
|
+
import { Button } from '../ui/button.js';
|
|
8
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '../ui/dialog.js';
|
|
9
|
+
import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from '../ui/table.js';
|
|
10
|
+
import { Spinner } from '../spinner/index.js';
|
|
11
|
+
import { useT } from '../../i18n/context.js';
|
|
12
|
+
import '../../packages/i18n/dist/index.esm.js';
|
|
13
|
+
import { resolveSpendCapsTabLabels } from './labels.js';
|
|
14
|
+
import { RowIconAction } from './row-icon-action.js';
|
|
15
|
+
import { SearchSelect } from './search-select.js';
|
|
16
|
+
import { usePlatformUserOptions } from './use-platform-user-options.js';
|
|
17
|
+
import { UserCapModal } from './user-cap-modal.js';
|
|
18
|
+
import { errorStatus, formatUsd, errorDetail } from './utils.js';
|
|
19
|
+
import ShieldAlert from '../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/shield-alert.js';
|
|
20
|
+
import SlidersHorizontal from '../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.js';
|
|
21
|
+
import Trash2 from '../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/trash-2.js';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Tenant-settings Billing "User Limits" tab: every user-scoped spend cap in
|
|
25
|
+
* the workspace (one user's spend across all agents, `spend-caps/users/`,
|
|
26
|
+
* iblai-platform#2513) — the Agent Limits layout with a user autocomplete
|
|
27
|
+
* filter (also the entry point for a user who has none yet), a direct status
|
|
28
|
+
* toggle per row, and edit/delete icons beside it. Add and edit both go
|
|
29
|
+
* through the same `UserCapModal` as the per-agent user limits. Rendered
|
|
30
|
+
* inside `BillingTab` above `NewUserDefaultSection`, whose rows end up here.
|
|
31
|
+
*/
|
|
32
|
+
function UserLimitsSection({ tenantKey, labels: labelsOverride }) {
|
|
33
|
+
var _a;
|
|
34
|
+
const t = useT();
|
|
35
|
+
const labels = React__default.useMemo(() => resolveSpendCapsTabLabels(labelsOverride, t), [labelsOverride, t]);
|
|
36
|
+
const copy = labels.tenantSections.users;
|
|
37
|
+
const [userFilter, setUserFilter] = React__default.useState(null);
|
|
38
|
+
const [userSearch, setUserSearch] = React__default.useState('');
|
|
39
|
+
const { options: userOptions, isSearching: isSearchingUsers } = usePlatformUserOptions(tenantKey, userSearch);
|
|
40
|
+
// The endpoint filters by username server-side — pass it through instead
|
|
41
|
+
// of fetching everything and filtering client-side.
|
|
42
|
+
const { data: visibleCaps = [], error: capsError, isLoading, isFetching, } = useListTenantUserSpendCapsQuery({ org: tenantKey, ...(userFilter ? { username: userFilter.value } : {}) }, { skip: !tenantKey });
|
|
43
|
+
const isForbidden = errorStatus(capsError) === 403;
|
|
44
|
+
const [upsertCap, { isLoading: isSaving }] = useUpsertTenantUserSpendCapMutation();
|
|
45
|
+
const [deleteCap, { isLoading: isDeleting }] = useDeleteTenantUserSpendCapMutation();
|
|
46
|
+
const [isModalOpen, setIsModalOpen] = React__default.useState(false);
|
|
47
|
+
const [editingCap, setEditingCap] = React__default.useState(null);
|
|
48
|
+
// Kept whole so the dialog can show the user's email while the delete
|
|
49
|
+
// call is still keyed by username.
|
|
50
|
+
const [pendingDelete, setPendingDelete] = React__default.useState(null);
|
|
51
|
+
// Whole-row click opens the user's profile (Management-tab pattern).
|
|
52
|
+
const [profileCap, setProfileCap] = React__default.useState(null);
|
|
53
|
+
const saveCap = async (username, formData) => {
|
|
54
|
+
try {
|
|
55
|
+
await upsertCap({ org: tenantKey, username, formData }).unwrap();
|
|
56
|
+
toast.success(labels.toasts.saved);
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error('[UserLimitsSection] save spend limit error', error);
|
|
61
|
+
toast.error(errorDetail(error) || labels.toasts.saveError);
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const removeCap = async (username) => {
|
|
66
|
+
try {
|
|
67
|
+
await deleteCap({ org: tenantKey, username }).unwrap();
|
|
68
|
+
toast.success(labels.toasts.deleted);
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error('[UserLimitsSection] delete spend limit error', error);
|
|
73
|
+
toast.error(errorDetail(error) || labels.toasts.deleteError);
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
// Status toggle saves immediately (datasets-table pattern) — the PUT is an
|
|
78
|
+
// upsert, so the cap's current fields ride along with the flipped flag.
|
|
79
|
+
const toggleEnabled = (cap, checked) => {
|
|
80
|
+
var _a;
|
|
81
|
+
void saveCap((_a = cap.username) !== null && _a !== void 0 ? _a : '', {
|
|
82
|
+
interval_type: cap.interval_type,
|
|
83
|
+
max_cost_usd: cap.max_cost_usd,
|
|
84
|
+
enforcement: cap.enforcement,
|
|
85
|
+
alert_thresholds: cap.alert_thresholds,
|
|
86
|
+
enabled: checked,
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
const openAddForFilteredUser = () => {
|
|
90
|
+
setEditingCap(null);
|
|
91
|
+
setIsModalOpen(true);
|
|
92
|
+
};
|
|
93
|
+
const openEdit = (cap) => {
|
|
94
|
+
setEditingCap(cap);
|
|
95
|
+
setIsModalOpen(true);
|
|
96
|
+
};
|
|
97
|
+
const handleConfirmDelete = async () => {
|
|
98
|
+
var _a;
|
|
99
|
+
if (!pendingDelete)
|
|
100
|
+
return;
|
|
101
|
+
const deleted = await removeCap((_a = pendingDelete.username) !== null && _a !== void 0 ? _a : '');
|
|
102
|
+
if (deleted)
|
|
103
|
+
setPendingDelete(null);
|
|
104
|
+
};
|
|
105
|
+
return (jsxs(Fragment, { children: [jsxs("div", { "data-testid": "spend-limits-users-section", className: "rounded-lg border border-[#e5e5e5] bg-white shadow-[0_1px_2px_0_rgba(0,0,0,0.05)] dark:bg-zinc-900 dark:border-zinc-800", children: [jsx("div", { className: "flex flex-col gap-2 p-4 sm:flex-row sm:items-start sm:justify-between", children: jsxs("div", { className: "space-y-0.5", children: [jsx("h3", { className: "text-[16px] font-medium leading-6 text-[#101828] dark:text-gray-100", children: copy.title }), jsx("p", { className: "text-[13px] font-normal leading-5 text-[#4a5565] dark:text-gray-400", children: copy.description })] }) }), jsx("div", { className: "space-y-3 border-t border-[#e5e7eb] dark:border-zinc-800 px-4 py-3", children: isForbidden ? (jsxs("div", { className: "flex flex-col items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-10 text-center", "data-testid": "user-limits-denied", children: [jsx(ShieldAlert, { className: "h-6 w-6 text-gray-400" }), jsx("p", { className: "text-sm font-medium text-gray-900", children: labels.denied.title }), jsx("p", { className: "max-w-sm text-xs text-gray-600", children: labels.denied.description })] })) : (jsxs(Fragment, { children: [jsx("div", { className: "max-w-sm", children: jsx(SearchSelect, { labels: copy.filter, selected: userFilter, onSelect: setUserFilter, onClear: () => setUserFilter(null), searchTerm: userSearch, onSearchTermChange: setUserSearch, options: userOptions, isLoading: isSearchingUsers, testId: "user-limits-filter" }) }), jsx("div", { className: "overflow-hidden rounded-md border", "data-testid": "user-limits-list", children: jsx("div", { className: "overflow-x-auto sm:mx-0", children: jsx("div", { className: "inline-block min-w-full align-middle", children: isLoading || isFetching ? (jsx("div", { className: "flex w-full items-center justify-center py-10", "data-testid": "user-limits-loading", children: jsx(Spinner, {}) })) : (jsxs(Table, { className: "min-w-full", children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "bg-muted/50 border-b", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: copy.table.userColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: copy.table.limitColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: copy.table.spentColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: copy.table.remainingColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: copy.table.statusColumn }), jsx(TableHead, { className: "w-20 p-3" })] }) }), jsx(TableBody, { children: visibleCaps.length === 0 ? (jsx(TableRow, { children: jsx(TableCell, { colSpan: 6, className: "p-4 text-center text-[#646464]", "data-testid": "user-limits-empty", children: jsxs("div", { className: "space-y-2", children: [jsx("p", { children: userFilter ? copy.emptyFiltered : copy.emptyState }), userFilter && (jsx(Button, { className: "ibl-button-primary", onClick: openAddForFilteredUser, disabled: isSaving || isDeleting, "data-testid": "user-limits-set-limit-button", children: copy.setLimitButton }))] }) }) })) : (visibleCaps.map((cap) => {
|
|
106
|
+
var _a;
|
|
107
|
+
const username = (_a = cap.username) !== null && _a !== void 0 ? _a : '';
|
|
108
|
+
// Email-first everywhere the user is shown or
|
|
109
|
+
// announced; testids and mutation keys stay on
|
|
110
|
+
// the backend's username key.
|
|
111
|
+
const displayName = cap.email || username;
|
|
112
|
+
return (jsxs(TableRow, { onClick: () => setProfileCap(cap), className: "cursor-pointer border-b transition-colors last:border-0 hover:bg-gray-50", "data-testid": `user-limits-row-${username}`, children: [jsx(TableCell, { className: "max-w-[240px] p-3 font-medium whitespace-nowrap text-[#646464]", children: jsx(UserProfileLink, { tenantKey: tenantKey, username: username, display: displayName, testId: `user-limits-profile-link-${username}` }) }), jsxs(TableCell, { className: "p-3 whitespace-nowrap text-[#646464]", children: [formatUsd(cap.max_cost_usd), " /", ' ', labels.form.intervalOptions[cap.interval_type]] }), jsx(TableCell, { className: "p-3 whitespace-nowrap text-[#646464]", children: formatUsd(cap.current_spend_usd) }), jsx(TableCell, { className: "p-3 whitespace-nowrap text-[#646464]", children: formatUsd(cap.remaining_usd) }), jsx(TableCell, { className: "p-3", onClick: (e) => e.stopPropagation(), children: jsxs("div", { className: "flex items-center gap-1.5", children: [jsx(CustomSwitch, { checked: cap.enabled, onCheckedChange: (checked) => toggleEnabled(cap, checked), disabled: isSaving || isDeleting, "aria-label": copy.statusToggleAria(displayName), "data-testid": `user-limits-status-switch-${username}` }), cap.is_exceeded && (jsx("span", { className: "rounded-full bg-red-100 px-2 py-0.5 text-[11px] font-medium text-red-700", children: labels.usage.exceededBadge })), cap.enforcement === 'alert_only' && (jsx("span", { className: "rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-medium text-amber-800", children: labels.usage.alertOnlyBadge }))] }) }), jsx(TableCell, { className: "p-3 text-right", onClick: (e) => e.stopPropagation(), children: jsxs("div", { className: "flex items-center justify-end gap-1", children: [jsx(RowIconAction, { label: copy.editAria(displayName), icon: SlidersHorizontal, onClick: () => openEdit(cap), disabled: isSaving || isDeleting, testId: `user-limits-edit-${username}` }), jsx(RowIconAction, { label: copy.deleteAria(displayName), icon: Trash2, onClick: () => setPendingDelete(cap), disabled: isSaving || isDeleting, className: "hover:text-red-600", testId: `user-limits-delete-${username}` })] }) })] }, cap.id));
|
|
113
|
+
})) })] })) }) }) })] })) })] }), jsx(UserProfileDialog, { tenantKey: tenantKey, username: (_a = profileCap === null || profileCap === void 0 ? void 0 : profileCap.username) !== null && _a !== void 0 ? _a : '', isOpen: profileCap !== null, onClose: () => setProfileCap(null) }), jsx(UserCapModal, { isOpen: isModalOpen, onClose: () => setIsModalOpen(false), cap: editingCap, initialUser: editingCap ? null : userFilter, labels: labels, tenantKey: tenantKey, isSaving: isSaving, onSave: saveCap }), jsx(Dialog, { open: pendingDelete !== null, onOpenChange: () => setPendingDelete(null), children: jsxs(DialogContent, { "aria-describedby": "user-limit-delete-description", "data-testid": "user-limit-delete-modal", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { className: "ibl-dialog-title", children: labels.deleteModal.title }) }), jsx("div", { className: "my-5", id: "user-limit-delete-description", children: jsxs("p", { className: "text-sm text-[#646464]", children: [jsx("span", { className: "font-bold italic", children: pendingDelete ? pendingDelete.email || pendingDelete.username : '' }), ' ', "\u2014 ", labels.deleteModal.description] }) }), jsxs(DialogFooter, { className: "gap-3", children: [jsx(Button, { variant: "outline", onClick: () => setPendingDelete(null), children: labels.deleteModal.cancel }), jsx(Button, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", onClick: handleConfirmDelete, disabled: isDeleting, "data-testid": "user-limit-delete-confirm", children: isDeleting ? labels.form.removing : labels.deleteModal.confirm })] })] }) })] }));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export { UserLimitsSection };
|
|
117
|
+
//# sourceMappingURL=user-limits-section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-limits-section.js","sources":["../../../../../../../src/components/spend-caps/user-limits-section.tsx"],"sourcesContent":[null],"names":["React","_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiDA;;;;;;;;AAQG;AACG,SAAU,iBAAiB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAA0B,EAAA;;AAC7F,IAAA,MAAM,CAAC,GAAG,IAAI,EAAE;IAChB,MAAM,MAAM,GAAGA,cAAK,CAAC,OAAO,CAC1B,MAAM,yBAAyB,CAAC,cAAc,EAAE,CAAC,CAAC,EAClD,CAAC,cAAc,EAAE,CAAC,CAAC,CACpB;AACD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK;AAExC,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAK,CAAC,QAAQ,CAA4B,IAAI,CAAC;AACnF,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;AACtD,IAAA,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,sBAAsB,CACpF,SAAS,EACT,UAAU,CACX;;;IAID,MAAM,EACJ,IAAI,EAAE,WAAW,GAAG,EAAE,EACtB,KAAK,EAAE,SAAS,EAChB,SAAS,EACT,UAAU,GACX,GAAG,+BAA+B,CACjC,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,UAAU,GAAG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