@bigbinary/neeto-custom-domains-frontend 2.0.2 → 2.0.4

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.
@@ -1,959 +0,0 @@
1
- 'use strict';
2
-
3
- var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
- var react = require('react');
5
- var neetoCist = require('@bigbinary/neeto-cist');
6
- var useDebounce = require('@bigbinary/neeto-commons-frontend/react-utils/useDebounce');
7
- var Container = require('@bigbinary/neeto-molecules/Container');
8
- var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
9
- var SubHeader = require('@bigbinary/neeto-molecules/SubHeader');
10
- var TableWrapper = require('@bigbinary/neeto-molecules/TableWrapper');
11
- var Table = require('@bigbinary/neetoui/Table');
12
- var Typography = require('@bigbinary/neetoui/Typography');
13
- var NoData = require('@bigbinary/neetoui/NoData');
14
- var Button = require('@bigbinary/neetoui/Button');
15
- var reactI18next = require('react-i18next');
16
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
17
- var reactQuery = require('@tanstack/react-query');
18
- var useMutationWithInvalidation = require('@bigbinary/neeto-commons-frontend/react-utils/useMutationWithInvalidation');
19
- var axios = require('axios');
20
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
21
- var Alert = require('@bigbinary/neetoui/Alert');
22
- var jsxRuntime = require('react/jsx-runtime');
23
- var constants = require('@bigbinary/neeto-commons-frontend/constants');
24
- var withT = require('@bigbinary/neeto-commons-frontend/react-utils/withT');
25
- var general = require('@bigbinary/neeto-commons-frontend/utils/general');
26
- var NeetoHeader = require('@bigbinary/neeto-molecules/Header');
27
- var Pane = require('@bigbinary/neetoui/Pane');
28
- var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
29
- var Input = require('@bigbinary/neetoui/formik/Input');
30
- var FormikForm = require('@bigbinary/neetoui/formik/Form');
31
- var i18next = require('i18next');
32
- var Yup = require('yup');
33
- var Checkbox = require('@bigbinary/neetoui/Checkbox');
34
- var Callout = require('@bigbinary/neetoui/Callout');
35
- var Stepper = require('@bigbinary/neetoui/Stepper');
36
- var CopyToClipboardButton = require('@bigbinary/neeto-molecules/CopyToClipboardButton');
37
- var Tag = require('@bigbinary/neetoui/Tag');
38
- var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
39
- var Toastr = require('@bigbinary/neetoui/Toastr');
40
- var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
41
- var classnames = require('classnames');
42
-
43
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
44
-
45
- function _interopNamespace(e) {
46
- if (e && e.__esModule) return e;
47
- var n = Object.create(null);
48
- if (e) {
49
- Object.keys(e).forEach(function (k) {
50
- if (k !== 'default') {
51
- var d = Object.getOwnPropertyDescriptor(e, k);
52
- Object.defineProperty(n, k, d.get ? d : {
53
- enumerable: true,
54
- get: function () { return e[k]; }
55
- });
56
- }
57
- });
58
- }
59
- n["default"] = e;
60
- return Object.freeze(n);
61
- }
62
-
63
- var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
64
- var useDebounce__default = /*#__PURE__*/_interopDefaultLegacy(useDebounce);
65
- var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
66
- var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
67
- var SubHeader__default = /*#__PURE__*/_interopDefaultLegacy(SubHeader);
68
- var TableWrapper__default = /*#__PURE__*/_interopDefaultLegacy(TableWrapper);
69
- var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
70
- var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
71
- var NoData__default = /*#__PURE__*/_interopDefaultLegacy(NoData);
72
- var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
73
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
74
- var useMutationWithInvalidation__default = /*#__PURE__*/_interopDefaultLegacy(useMutationWithInvalidation);
75
- var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
76
- var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
77
- var withT__default = /*#__PURE__*/_interopDefaultLegacy(withT);
78
- var NeetoHeader__default = /*#__PURE__*/_interopDefaultLegacy(NeetoHeader);
79
- var Pane__default = /*#__PURE__*/_interopDefaultLegacy(Pane);
80
- var ActionBlock__default = /*#__PURE__*/_interopDefaultLegacy(ActionBlock);
81
- var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
82
- var FormikForm__default = /*#__PURE__*/_interopDefaultLegacy(FormikForm);
83
- var Yup__namespace = /*#__PURE__*/_interopNamespace(Yup);
84
- var Checkbox__default = /*#__PURE__*/_interopDefaultLegacy(Checkbox);
85
- var Callout__default = /*#__PURE__*/_interopDefaultLegacy(Callout);
86
- var Stepper__default = /*#__PURE__*/_interopDefaultLegacy(Stepper);
87
- var CopyToClipboardButton__default = /*#__PURE__*/_interopDefaultLegacy(CopyToClipboardButton);
88
- var Tag__default = /*#__PURE__*/_interopDefaultLegacy(Tag);
89
- var Toastr__default = /*#__PURE__*/_interopDefaultLegacy(Toastr);
90
- var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
91
- var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
92
-
93
- var getUrlwithId = function getUrlwithId(url, id) {
94
- return id ? "".concat(url, "/").concat(id) : url;
95
- };
96
- var fetchCustomDomain = function fetchCustomDomain(url) {
97
- return axios__default["default"].get(url);
98
- };
99
- var updateCustomDomain = function updateCustomDomain(url, id) {
100
- return axios__default["default"].patch(getUrlwithId(url, id));
101
- };
102
- var createCustomDomain = function createCustomDomain(url, payload) {
103
- return axios__default["default"].post(url, payload);
104
- };
105
- var deleteCustomDomain = function deleteCustomDomain(url) {
106
- return axios__default["default"]["delete"](getUrlwithId(url));
107
- };
108
- var validateDomain = function validateDomain(url) {
109
- return axios__default["default"].patch("".concat(url, "/validate_domain"), undefined, {
110
- showToastr: false
111
- });
112
- };
113
- var validateCname = function validateCname(url, id) {
114
- return axios__default["default"].patch("".concat(getUrlwithId(url, id), "/validate_cname"));
115
- };
116
- var domainsApi = {
117
- createCustomDomain: createCustomDomain,
118
- deleteCustomDomain: deleteCustomDomain,
119
- validateDomain: validateDomain,
120
- fetchCustomDomain: fetchCustomDomain,
121
- validateCname: validateCname,
122
- updateCustomDomain: updateCustomDomain
123
- };
124
-
125
- var DOMAIN_QUERY_KEY = "custom-domain";
126
-
127
- function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
128
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
129
- var useCreateCustomDomain = function useCreateCustomDomain(url) {
130
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
131
- return useMutationWithInvalidation__default["default"](function (payload) {
132
- return domainsApi.createCustomDomain(url, payload);
133
- }, _objectSpread$3({
134
- keysToInvalidate: [[DOMAIN_QUERY_KEY]]
135
- }, options));
136
- };
137
- var useDeleteCustomDomain = function useDeleteCustomDomain(url) {
138
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
139
- return useMutationWithInvalidation__default["default"](function (id) {
140
- return domainsApi.deleteCustomDomain(url, id);
141
- }, _objectSpread$3({
142
- keysToInvalidate: [[DOMAIN_QUERY_KEY]]
143
- }, options));
144
- };
145
- var useFetchCustomDomain = function useFetchCustomDomain(params) {
146
- console.log("query");
147
- return reactQuery.useQuery({
148
- queryKey: [DOMAIN_QUERY_KEY, _objectSpread$3({}, params)],
149
- queryFn: function queryFn() {
150
- return domainsApi.fetchCustomDomain(params);
151
- }
152
- });
153
- };
154
- var useValidateDomain = function useValidateDomain(url) {
155
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
156
- return useMutationWithInvalidation__default["default"](function () {
157
- return domainsApi.validateDomain(url);
158
- }, _objectSpread$3({
159
- keysToInvalidate: [[DOMAIN_QUERY_KEY]]
160
- }, options));
161
- };
162
- var useUpdateCustomDomain = function useUpdateCustomDomain(url) {
163
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
164
- return useMutationWithInvalidation__default["default"](function (id) {
165
- return domainsApi.updateCustomDomain(url, id);
166
- }, _objectSpread$3({
167
- keysToInvalidate: [[DOMAIN_QUERY_KEY]]
168
- }, options));
169
- };
170
-
171
- var DeleteAlert = reactUtils.withT(function (_ref) {
172
- var t = _ref.t,
173
- onClose = _ref.onClose,
174
- onSubmit = _ref.onSubmit,
175
- isOpen = _ref.isOpen,
176
- isSubmitting = _ref.isSubmitting,
177
- hostname = _ref.hostname;
178
- return /*#__PURE__*/jsxRuntime.jsx(Alert__default["default"], {
179
- isOpen: isOpen,
180
- isSubmitting: isSubmitting,
181
- onClose: onClose,
182
- onSubmit: onSubmit,
183
- cancelButtonLabel: t("neetoCustomDomains.actions.cancel"),
184
- submitButtonLabel: t("neetoCustomDomains.actions.delete"),
185
- title: t("neetoCustomDomains.delete"),
186
- message: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
187
- i18nKey: "neetoCustomDomains.alertMessage",
188
- values: {
189
- hostname: hostname
190
- }
191
- })
192
- });
193
- });
194
-
195
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
196
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
197
- var Header = withT__default["default"](function (_ref) {
198
- var t = _ref.t,
199
- setIsPaneOpen = _ref.setIsPaneOpen,
200
- searchTerm = _ref.searchTerm,
201
- setSearchTerm = _ref.setSearchTerm,
202
- headerProps = _ref.headerProps,
203
- isFiltersVisible = _ref.isFiltersVisible;
204
- return /*#__PURE__*/jsxRuntime.jsx(NeetoHeader__default["default"], _objectSpread$2({
205
- "data-testid": "custom-domain-header",
206
- title: t("neetoCustomDomains.customDomain", constants.PLURAL),
207
- actionBlock: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
208
- "data-cy": "add-new-custom-domain-button",
209
- label: t("neetoCustomDomains.addNew"),
210
- onClick: function onClick() {
211
- return setIsPaneOpen(true);
212
- }
213
- }),
214
- searchProps: isFiltersVisible && {
215
- value: searchTerm,
216
- onChange: general.withEventTargetValue(setSearchTerm),
217
- placeholder: t("neetoCustomDomains.search"),
218
- "data-cy": "custom-domain-search-field",
219
- className: "w-56"
220
- }
221
- }, headerProps));
222
- });
223
- var Header$1 = /*#__PURE__*/react.memo(Header);
224
-
225
- var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
226
-
227
- var css = ".neeto-molecule-custom-domain-pane{width:min(90%,1280px)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy9jb21wb25lbnRzL0N1c3RvbURvbWFpbkRhc2hib2FyZC9NYW5hZ2UvY3VzdG9tLWRvbWFpbi5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG1DQUNFLHFCQUNGIiwic291cmNlc0NvbnRlbnQiOlsiLm5lZXRvLW1vbGVjdWxlLWN1c3RvbS1kb21haW4tcGFuZSB7XG4gIHdpZHRoOiBtaW4oOTAlLCAxMjgwcHgpO1xufVxuIl19 */";
228
- n(css,{});
229
-
230
- var HOSTNAME_REGEX = /^(https?:\/\/)?([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}(\/\S*)?$/;
231
- var INITIAL_VALUES = {
232
- hostname: ""
233
- };
234
- var STATUS_INDEX = ["pending_domain_validation", "pending_cname_validation", "active"];
235
- var DOMAIN_VALIDATION_STATUS = "pending_domain_validation";
236
- var STEPS = [{
237
- id: 1,
238
- label: "Domain validation"
239
- }, {
240
- id: 2,
241
- label: "Domain redirection"
242
- }];
243
-
244
- var getCustomDomainValidationSchema = function getCustomDomainValidationSchema() {
245
- return Yup__namespace.object().shape({
246
- hostname: Yup__namespace.string().required(i18next.t("neetoCustomDomains.formikValidation.required")).matches(HOSTNAME_REGEX, i18next.t("neetoCustomDomains.formikValidation.valid"))
247
- });
248
- };
249
-
250
- var DomainField = function DomainField(_ref) {
251
- var customDomain = _ref.customDomain,
252
- onCreate = _ref.onCreate,
253
- url = _ref.url,
254
- setCustomDomain = _ref.setCustomDomain,
255
- onClose = _ref.onClose;
256
- var _useTranslation = reactI18next.useTranslation(),
257
- t = _useTranslation.t;
258
- var _useCreateCustomDomai = useCreateCustomDomain(url),
259
- createCustomDomain = _useCreateCustomDomai.mutate,
260
- isCreating = _useCreateCustomDomai.isPending;
261
- var getHostname = function getHostname(url) {
262
- try {
263
- var parsedUrl = new URL(url);
264
- return parsedUrl.hostname;
265
- } catch (_unused) {
266
- return url;
267
- }
268
- };
269
- var handleSubmit = function handleSubmit(_ref2) {
270
- var hostname = _ref2.hostname;
271
- var parsedHostname = getHostname(hostname);
272
- var payload = {
273
- hostname: parsedHostname
274
- };
275
- createCustomDomain(payload, {
276
- onSuccess: function onSuccess(values) {
277
- setCustomDomain(values);
278
- onCreate === null || onCreate === void 0 ? void 0 : onCreate(values);
279
- }
280
- });
281
- };
282
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
283
- children: [/*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Header, {
284
- children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
285
- style: "h2",
286
- children: t("neetoCustomDomains.addNew")
287
- })
288
- }), /*#__PURE__*/jsxRuntime.jsx(FormikForm__default["default"], {
289
- className: "flex-col space-y-6",
290
- formikProps: {
291
- enableReinitialize: true,
292
- initialValues: customDomain || INITIAL_VALUES,
293
- validationSchema: getCustomDomainValidationSchema(),
294
- onSubmit: handleSubmit
295
- },
296
- children: function children(_ref3) {
297
- var dirty = _ref3.dirty;
298
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
299
- className: "w-full",
300
- children: [/*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Body, {
301
- children: /*#__PURE__*/jsxRuntime.jsx(Input__default["default"], {
302
- required: true,
303
- className: "w-full",
304
- "data-cy": "custom-domain-input-field",
305
- disabled: neetoCist.isNotEmpty(customDomain),
306
- label: t("neetoCustomDomains.label"),
307
- name: "hostname",
308
- placeholder: t("neetoCustomDomains.placeholder")
309
- })
310
- }), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Footer, {
311
- children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock__default["default"], {
312
- cancelButtonProps: {
313
- onClick: onClose
314
- },
315
- isSubmitting: isCreating,
316
- submitButtonProps: {
317
- label: t("neetoCustomDomains.actions.continue"),
318
- "data-cy": "submit-custom-domain-button",
319
- "data-testid": "submit-custom-domain-button",
320
- disabled: !dirty || isCreating
321
- }
322
- })
323
- })]
324
- });
325
- }
326
- })]
327
- });
328
- };
329
-
330
- var Common = reactUtils.withT(function (_ref) {
331
- var t = _ref.t,
332
- currentStep = _ref.currentStep,
333
- handleStepChange = _ref.handleStepChange,
334
- hostname = _ref.hostname;
335
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
336
- className: "mb-6 w-full space-y-6",
337
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
338
- className: "-ml-2",
339
- children: /*#__PURE__*/jsxRuntime.jsx(Stepper__default["default"], {
340
- activeIndex: currentStep,
341
- setActiveIndex: handleStepChange,
342
- steps: STEPS
343
- })
344
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
345
- className: "space-y-1",
346
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
347
- style: "h4",
348
- children: t("neetoCustomDomains.yourDomain")
349
- }), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
350
- style: "body1",
351
- children: hostname
352
- })]
353
- })]
354
- });
355
- });
356
-
357
- var columnData = function columnData() {
358
- return [{
359
- title: i18next.t("neetoCustomDomains.common.record"),
360
- key: "record",
361
- dataIndex: "record",
362
- width: "90px",
363
- render: function render() {
364
- return /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
365
- style: "body2",
366
- children: i18next.t("neetoCustomDomains.cname")
367
- });
368
- }
369
- }, {
370
- title: i18next.t("neetoCustomDomains.common.name"),
371
- dataIndex: "name",
372
- width: "35%",
373
- key: "name",
374
- render: function render(name, _) {
375
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
376
- className: "flex items-center justify-between gap-1",
377
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
378
- className: "min-w-0 truncate",
379
- style: "body2",
380
- children: name
381
- }), /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton__default["default"], {
382
- className: "flex-shrink-0",
383
- size: "small",
384
- style: "secondary",
385
- value: name
386
- })]
387
- });
388
- }
389
- }, {
390
- title: i18next.t("neetoCustomDomains.common.value"),
391
- dataIndex: "value",
392
- width: "35%",
393
- key: "value",
394
- render: function render(value, _) {
395
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
396
- className: "flex items-center justify-between gap-1",
397
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
398
- className: "min-w-0 truncate",
399
- style: "body2",
400
- children: value
401
- }), /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton__default["default"], {
402
- value: value,
403
- className: "flex-shrink-0",
404
- size: "small",
405
- style: "secondary"
406
- })]
407
- });
408
- }
409
- }, {
410
- title: i18next.t("neetoCustomDomains.common.status"),
411
- dataIndex: "status",
412
- key: "status",
413
- width: "130px",
414
- render: function render(status) {
415
- return /*#__PURE__*/jsxRuntime.jsx(Tag__default["default"], {
416
- label: i18next.t("neetoCustomDomains.common.".concat(status)),
417
- style: status === "success" ? "success" : "warning"
418
- });
419
- }
420
- }];
421
- };
422
-
423
- var HELP_DOC_URL = "https://help.".concat(initializers.globalProps.appName.toLowerCase(), ".com/articles/custom-domains");
424
-
425
- var Redirection = function Redirection(_ref) {
426
- var customDomain = _ref.customDomain,
427
- onClose = _ref.onClose,
428
- setCustomDomain = _ref.setCustomDomain,
429
- url = _ref.url,
430
- currentStep = _ref.currentStep,
431
- handleStepChange = _ref.handleStepChange,
432
- incrementStep = _ref.incrementStep,
433
- hasOne = _ref.hasOne;
434
- var _useTranslation = reactI18next.useTranslation(),
435
- t = _useTranslation.t;
436
- var id = customDomain.id,
437
- hostname = customDomain.hostname,
438
- dnsTarget = customDomain.dnsTarget,
439
- addedCnameAt = customDomain.addedCnameAt,
440
- status = customDomain.status;
441
- var cnameAdded = neetoCist.isPresent(addedCnameAt);
442
- var customDomainId = hasOne ? null : id;
443
- var _useState = react.useState(cnameAdded),
444
- _useState2 = _slicedToArray__default["default"](_useState, 2),
445
- addedRedirectionCname = _useState2[0],
446
- setAddedRedirectionCname = _useState2[1];
447
- var _useUpdateCustomDomai = useUpdateCustomDomain(url),
448
- updateCustomDomain = _useUpdateCustomDomai.mutate,
449
- isUpdating = _useUpdateCustomDomai.isPending;
450
- var handleUpdateCname = function handleUpdateCname() {
451
- addedRedirectionCname && updateCustomDomain(customDomainId, {
452
- onSuccess: function onSuccess(data) {
453
- incrementStep();
454
- setCustomDomain(data);
455
- }
456
- });
457
- };
458
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
459
- children: [/*#__PURE__*/jsxRuntime.jsxs(Pane__default["default"].Body, {
460
- children: [/*#__PURE__*/jsxRuntime.jsx(Common, {
461
- currentStep: currentStep,
462
- handleStepChange: handleStepChange,
463
- hostname: hostname
464
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
465
- className: "mb-6 w-full space-y-6",
466
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
467
- className: "space-y-1",
468
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
469
- style: "h4",
470
- children: t("neetoCustomDomains.domainRedirection")
471
- }), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
472
- style: "body2",
473
- children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
474
- i18nKey: "neetoCustomDomains.cnameRecordInfo",
475
- components: {
476
- Link: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
477
- href: HELP_DOC_URL,
478
- rel: "noreferrer",
479
- style: "link",
480
- target: "_blank"
481
- })
482
- }
483
- })
484
- })]
485
- }), /*#__PURE__*/jsxRuntime.jsx(TableWrapper__default["default"], {
486
- className: "pb-0",
487
- children: /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
488
- allowRowClick: false,
489
- columnData: columnData(),
490
- rowSelection: false,
491
- rowData: [{
492
- name: hostname,
493
- value: dnsTarget,
494
- status: status === "active" ? "success" : "pending"
495
- }]
496
- })
497
- }), /*#__PURE__*/jsxRuntime.jsx(Checkbox__default["default"], {
498
- checked: addedRedirectionCname,
499
- "data-testid": "cname-added-custom-domain-checkbox",
500
- disabled: cnameAdded,
501
- label: t("neetoCustomDomains.cnameAdded"),
502
- onChange: function onChange() {
503
- return setAddedRedirectionCname(function (value) {
504
- return !value;
505
- });
506
- }
507
- })]
508
- }), cnameAdded && /*#__PURE__*/jsxRuntime.jsx(Callout__default["default"], {
509
- style: "warning",
510
- children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
511
- style: "body2",
512
- children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
513
- i18nKey: "neetoCustomDomains.domainRedirectionInfo",
514
- values: {
515
- hostname: hostname
516
- },
517
- components: {
518
- Link: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
519
- href: HELP_DOC_URL,
520
- rel: "noreferrer",
521
- style: "link",
522
- target: "_blank"
523
- })
524
- }
525
- })
526
- })
527
- })]
528
- }), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Footer, {
529
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
530
- className: "flex items-center gap-2",
531
- children: [status !== "active" ? /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
532
- disabled: isUpdating || !addedRedirectionCname,
533
- label: t("neetoCustomDomains.actions.continue"),
534
- loading: isUpdating,
535
- onClick: handleUpdateCname
536
- }) : /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
537
- label: t("neetoCustomDomains.actions.done"),
538
- onClick: onClose
539
- }), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
540
- label: t("neetoCustomDomains.actions.cancel"),
541
- style: "text",
542
- onClick: onClose
543
- })]
544
- })
545
- })]
546
- });
547
- };
548
-
549
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
550
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
551
- var Validation = function Validation(_ref) {
552
- var customDomain = _ref.customDomain,
553
- onClose = _ref.onClose,
554
- setCustomDomain = _ref.setCustomDomain,
555
- url = _ref.url,
556
- currentStep = _ref.currentStep,
557
- handleStepChange = _ref.handleStepChange,
558
- incrementStep = _ref.incrementStep,
559
- hasOne = _ref.hasOne;
560
- var _useTranslation = reactI18next.useTranslation(),
561
- t = _useTranslation.t;
562
- var id = customDomain.id,
563
- hostname = customDomain.hostname,
564
- cnameValidationParams = customDomain.cnameValidationParams,
565
- status = customDomain.status;
566
- var isDomainValidated = status !== "pending_domain_validation";
567
- var customDomainId = hasOne ? null : id;
568
- var _useState = react.useState(false),
569
- _useState2 = _slicedToArray__default["default"](_useState, 2),
570
- showValidationWarning = _useState2[0],
571
- setShowValidationWarning = _useState2[1];
572
- var _useValidateDomain = useValidateDomain(url),
573
- validateDomain = _useValidateDomain.mutate,
574
- isValidating = _useValidateDomain.isPending;
575
- var handleValidateDomain = function handleValidateDomain() {
576
- return validateDomain(customDomainId, {
577
- onError: function onError() {
578
- setShowValidationWarning(true);
579
- },
580
- onSuccess: function onSuccess(values) {
581
- Toastr__default["default"].success(t("neetoCustomDomains.validation.successMessage"));
582
- incrementStep();
583
- setCustomDomain(values);
584
- }
585
- });
586
- };
587
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
588
- children: [/*#__PURE__*/jsxRuntime.jsxs(Pane__default["default"].Body, {
589
- children: [/*#__PURE__*/jsxRuntime.jsx(Common, {
590
- currentStep: currentStep,
591
- handleStepChange: handleStepChange,
592
- hostname: hostname
593
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
594
- className: "mb-6 w-full space-y-6",
595
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
596
- className: "space-y-1",
597
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
598
- style: "h4",
599
- children: t("neetoCustomDomains.domainValidation")
600
- }), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
601
- style: "body2",
602
- children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
603
- i18nKey: "neetoCustomDomains.cnameRecordInfo",
604
- components: {
605
- Link: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
606
- href: HELP_DOC_URL,
607
- rel: "noreferrer",
608
- style: "link",
609
- target: "_blank"
610
- })
611
- },
612
- values: {
613
- proxyMessage: t("neetoCustomDomains.proxyMessage")
614
- }
615
- })
616
- })]
617
- }), /*#__PURE__*/jsxRuntime.jsx(TableWrapper__default["default"], {
618
- className: "pb-0",
619
- children: /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
620
- allowRowClick: false,
621
- columnData: columnData(),
622
- rowSelection: false,
623
- rowData: [_objectSpread$1(_objectSpread$1({}, cnameValidationParams), {}, {
624
- status: isDomainValidated ? "success" : "pending"
625
- })]
626
- })
627
- })]
628
- }), showValidationWarning && /*#__PURE__*/jsxRuntime.jsx(Callout__default["default"], {
629
- style: "warning",
630
- children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
631
- style: "body2",
632
- children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
633
- i18nKey: "neetoCustomDomains.domainValidationInfo",
634
- components: {
635
- Link: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
636
- href: HELP_DOC_URL,
637
- rel: "noreferrer",
638
- style: "link",
639
- target: "_blank"
640
- })
641
- }
642
- })
643
- })
644
- })]
645
- }), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Footer, {
646
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
647
- className: "flex items-center gap-2",
648
- children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
649
- disabled: isValidating,
650
- loading: isValidating,
651
- "data-cy": isDomainValidated ? "continue-button" : "validate-domain-button",
652
- label: isDomainValidated ? t("neetoCustomDomains.actions.continue") : t("neetoCustomDomains.validation.buttonLabel.domain"),
653
- onClick: isDomainValidated ? incrementStep : handleValidateDomain
654
- }), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
655
- label: t("neetoCustomDomains.actions.cancel"),
656
- style: "text",
657
- onClick: onClose
658
- })]
659
- })
660
- })]
661
- });
662
- };
663
-
664
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
665
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
666
- var Settings = function Settings(_ref) {
667
- var customDomain = _ref.customDomain,
668
- url = _ref.url,
669
- onClose = _ref.onClose,
670
- setCustomDomain = _ref.setCustomDomain,
671
- hasOne = _ref.hasOne;
672
- var _useTranslation = reactI18next.useTranslation(),
673
- t = _useTranslation.t;
674
- var status = customDomain.status;
675
- var _useState = react.useState(STATUS_INDEX.indexOf(status)),
676
- _useState2 = _slicedToArray__default["default"](_useState, 2),
677
- currentStep = _useState2[0],
678
- setCurrentStep = _useState2[1];
679
- var isNotValidationStep = STATUS_INDEX[currentStep] !== DOMAIN_VALIDATION_STATUS;
680
- var handleStepChange = function handleStepChange(index) {
681
- status !== DOMAIN_VALIDATION_STATUS && setCurrentStep(index);
682
- };
683
- var incrementStep = function incrementStep() {
684
- return setCurrentStep(function (step) {
685
- return step + 1;
686
- });
687
- };
688
- var recordProps = {
689
- currentStep: currentStep,
690
- customDomain: customDomain,
691
- handleStepChange: handleStepChange,
692
- onClose: onClose,
693
- setCustomDomain: setCustomDomain,
694
- url: url,
695
- incrementStep: incrementStep,
696
- hasOne: hasOne
697
- };
698
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
699
- children: [/*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Header, {
700
- children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
701
- style: "h2",
702
- children: t("neetoCustomDomains.settings")
703
- })
704
- }), isNotValidationStep ? /*#__PURE__*/jsxRuntime.jsx(Redirection, _objectSpread({}, recordProps)) : /*#__PURE__*/jsxRuntime.jsx(Validation, _objectSpread({}, recordProps))]
705
- });
706
- };
707
-
708
- var Manage = function Manage(_ref) {
709
- var isOpen = _ref.isOpen,
710
- onClose = _ref.onClose,
711
- customDomain = _ref.customDomain,
712
- setCustomDomain = _ref.setCustomDomain,
713
- url = _ref.url,
714
- hasOne = _ref.hasOne,
715
- onCreate = _ref.onCreate;
716
- return /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"], {
717
- isOpen: isOpen,
718
- onClose: onClose,
719
- className: "neeto-molecule-custom-domain-pane",
720
- size: "large",
721
- children: customDomain !== null && customDomain !== void 0 && customDomain.id ? /*#__PURE__*/jsxRuntime.jsx(Settings, {
722
- customDomain: customDomain,
723
- hasOne: hasOne,
724
- onClose: onClose,
725
- setCustomDomain: setCustomDomain,
726
- url: url
727
- }) : /*#__PURE__*/jsxRuntime.jsx(DomainField, {
728
- customDomain: customDomain,
729
- onClose: onClose,
730
- onCreate: onCreate,
731
- setCustomDomain: setCustomDomain,
732
- url: url
733
- })
734
- });
735
- };
736
-
737
- var TagBlock = function TagBlock(_ref) {
738
- var status = _ref.status,
739
- _ref$stacked = _ref.stacked,
740
- stacked = _ref$stacked === void 0 ? false : _ref$stacked;
741
- var _useTranslation = reactI18next.useTranslation(),
742
- t = _useTranslation.t;
743
- var isDomainValidated = status === "active" || status === "pending_cname_validation";
744
- var camelCasedStatus = neetoCist.snakeToCamelCase(status || "");
745
- return /*#__PURE__*/jsxRuntime.jsx("div", {
746
- className: classnames__default["default"]("flex gap-2", {
747
- "flex-col items-start": stacked
748
- }),
749
- children: status === "failed" ? /*#__PURE__*/jsxRuntime.jsx(Tag__default["default"], {
750
- label: t("neetoCustomDomains.status.".concat(camelCasedStatus)),
751
- style: "danger"
752
- }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
753
- children: [/*#__PURE__*/jsxRuntime.jsx(Tag__default["default"], {
754
- "data-cy": "".concat(general.hyphenize(status), "-tag-container"),
755
- label: t("neetoCustomDomains.status.domain.".concat(camelCasedStatus)),
756
- style: isDomainValidated ? "success" : "warning"
757
- }), isDomainValidated && /*#__PURE__*/jsxRuntime.jsx("div", {
758
- className: classnames__default["default"]("flex items-center justify-between gap-2", {
759
- "w-full": stacked
760
- }),
761
- children: /*#__PURE__*/jsxRuntime.jsx(Tag__default["default"], {
762
- "data-cy": "".concat(general.hyphenize(status), "-tag-container"),
763
- label: t("neetoCustomDomains.status.cname.".concat(camelCasedStatus)),
764
- style: status === "active" ? "success" : "warning"
765
- })
766
- })]
767
- })
768
- });
769
- };
770
- var TagBlock$1 = /*#__PURE__*/react.memo(TagBlock);
771
-
772
- var renderColumnData = function renderColumnData(enableManagePane, enableDeleteAlert) {
773
- return [{
774
- title: i18next.t("neetoCustomDomains.customDomain", constants.SINGULAR),
775
- dataIndex: "hostname",
776
- key: "hostname",
777
- width: "60%",
778
- render: function render(hostName, customDomain) {
779
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
780
- className: "flex items-center justify-between gap-x-3",
781
- children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
782
- "data-cy": "hostname-button",
783
- label: hostName,
784
- style: "link",
785
- onClick: function onClick() {
786
- return enableManagePane(customDomain);
787
- }
788
- }), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
789
- dropdownButtonProps: {
790
- "data-testid": "nui-dropdown-icon-".concat(customDomain.id)
791
- },
792
- dropdownProps: {
793
- position: "bottom-end",
794
- strategy: "fixed",
795
- autoWidth: true
796
- },
797
- menuItems: [{
798
- label: i18next.t("neetoCustomDomains.actions.edit"),
799
- onClick: function onClick() {
800
- return enableManagePane(customDomain);
801
- },
802
- key: "edit-custom-domain-button"
803
- }, {
804
- label: i18next.t("neetoCustomDomains.actions.delete"),
805
- onClick: function onClick() {
806
- return enableDeleteAlert(customDomain);
807
- },
808
- key: "delete-custom-domain"
809
- }]
810
- })]
811
- });
812
- }
813
- }, {
814
- title: i18next.t("neetoCustomDomains.common.status"),
815
- dataIndex: "status",
816
- key: "status",
817
- render: function render(status) {
818
- return /*#__PURE__*/jsxRuntime.jsx(TagBlock$1, {
819
- status: status
820
- });
821
- },
822
- width: "40%"
823
- }];
824
- };
825
-
826
- var CustomDomainDashboard = function CustomDomainDashboard(_ref) {
827
- var _data$customDomains, _data$customDomains2;
828
- var headerProps = _ref.headerProps,
829
- url = _ref.url,
830
- onCreate = _ref.onCreate;
831
- var _useState = react.useState(""),
832
- _useState2 = _slicedToArray__default["default"](_useState, 2),
833
- searchTerm = _useState2[0],
834
- setSearchTerm = _useState2[1];
835
- var _useState3 = react.useState(false),
836
- _useState4 = _slicedToArray__default["default"](_useState3, 2),
837
- isPaneOpen = _useState4[0],
838
- setIsPaneOpen = _useState4[1];
839
- var _useState5 = react.useState({}),
840
- _useState6 = _slicedToArray__default["default"](_useState5, 2),
841
- customDomain = _useState6[0],
842
- setCustomDomain = _useState6[1];
843
- var _useState7 = react.useState(false),
844
- _useState8 = _slicedToArray__default["default"](_useState7, 2),
845
- isAlertOpen = _useState8[0],
846
- setIsAlertOpen = _useState8[1];
847
- var _useTranslation = reactI18next.useTranslation(),
848
- t = _useTranslation.t;
849
- var debouncedSearchTerm = useDebounce__default["default"](searchTerm, 500);
850
- var _useFetchCustomDomain = useFetchCustomDomain({
851
- url: url,
852
- params: {
853
- searchTerm: debouncedSearchTerm
854
- }
855
- }),
856
- data = _useFetchCustomDomain.data,
857
- isLoading = _useFetchCustomDomain.isLoading;
858
- var isFiltersVisible = neetoCist.isNotEmpty(data === null || data === void 0 ? void 0 : data.customDomains) || neetoCist.isPresent(searchTerm);
859
- var _useDeleteCustomDomai = useDeleteCustomDomain(url, {
860
- onSettled: function onSettled() {
861
- setIsAlertOpen(false);
862
- setCustomDomain({});
863
- }
864
- }),
865
- deleteCustomDomain = _useDeleteCustomDomai.mutate,
866
- isDeleting = _useDeleteCustomDomai.isPending;
867
- var enableManagePane = function enableManagePane(customDomain) {
868
- setCustomDomain(customDomain);
869
- setIsPaneOpen(true);
870
- };
871
- var enableDeleteAlert = function enableDeleteAlert(customDomain) {
872
- setCustomDomain(customDomain);
873
- setIsAlertOpen(true);
874
- };
875
- var disableManagePane = function disableManagePane() {
876
- setIsPaneOpen(false);
877
- setCustomDomain({});
878
- };
879
- var disableDeleteAlert = function disableDeleteAlert() {
880
- setIsAlertOpen(false);
881
- setCustomDomain({});
882
- };
883
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
884
- children: [/*#__PURE__*/jsxRuntime.jsxs(Container__default["default"], {
885
- children: [/*#__PURE__*/jsxRuntime.jsx(Header$1, {
886
- headerProps: headerProps,
887
- isFiltersVisible: isFiltersVisible,
888
- searchTerm: searchTerm,
889
- setIsPaneOpen: setIsPaneOpen,
890
- setSearchTerm: setSearchTerm
891
- }), isLoading && /*#__PURE__*/jsxRuntime.jsx("div", {
892
- className: "h-screen w-full",
893
- children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
894
- }), !isLoading && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
895
- children: [/*#__PURE__*/jsxRuntime.jsx(SubHeader__default["default"], {
896
- leftActionBlock: !!(data !== null && data !== void 0 && (_data$customDomains = data.customDomains) !== null && _data$customDomains !== void 0 && _data$customDomains.length) && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
897
- className: "neeto-ui-gray-800 font-semibold",
898
- component: "h4",
899
- children: t("neetoCustomDomains.customDomainWithCount", {
900
- count: data === null || data === void 0 ? void 0 : (_data$customDomains2 = data.customDomains) === null || _data$customDomains2 === void 0 ? void 0 : _data$customDomains2.length
901
- })
902
- })
903
- }), neetoCist.isNotEmpty(data === null || data === void 0 ? void 0 : data.customDomains) ? /*#__PURE__*/jsxRuntime.jsx(TableWrapper__default["default"], {
904
- children: /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
905
- fixedHeight: true,
906
- allowRowClick: false,
907
- rowData: data === null || data === void 0 ? void 0 : data.customDomains,
908
- rowSelection: false,
909
- columnData: renderColumnData(enableManagePane, enableDeleteAlert)
910
- })
911
- }) : /*#__PURE__*/jsxRuntime.jsx("div", {
912
- className: "flex h-full w-full flex-grow items-center justify-center",
913
- children: /*#__PURE__*/jsxRuntime.jsx(NoData__default["default"], {
914
- title: t("neetoCustomDomains.notFound"),
915
- helpText: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
916
- i18nKey: "neetoCustomDomains.learnMoreMessage",
917
- components: {
918
- button: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
919
- href: "https://help.neetosite.com/p/a-95ad5b03",
920
- style: "link",
921
- target: "_blank"
922
- })
923
- }
924
- }),
925
- primaryButtonProps: {
926
- label: t("neetoCustomDomains.addNew"),
927
- onClick: function onClick() {
928
- return setIsPaneOpen(true);
929
- }
930
- }
931
- })
932
- })]
933
- })]
934
- }), /*#__PURE__*/jsxRuntime.jsx(Manage, {
935
- customDomain: customDomain,
936
- onCreate: onCreate,
937
- setCustomDomain: setCustomDomain,
938
- url: url,
939
- hasOne: false,
940
- isOpen: isPaneOpen,
941
- onClose: disableManagePane
942
- }), /*#__PURE__*/jsxRuntime.jsx(DeleteAlert, {
943
- hostname: customDomain === null || customDomain === void 0 ? void 0 : customDomain.hostname,
944
- isOpen: isAlertOpen,
945
- isSubmitting: isDeleting,
946
- onClose: disableDeleteAlert,
947
- onSubmit: function onSubmit() {
948
- return deleteCustomDomain(customDomain === null || customDomain === void 0 ? void 0 : customDomain.id);
949
- }
950
- })]
951
- });
952
- };
953
-
954
- exports.CustomDomainDashboard = CustomDomainDashboard;
955
- exports.useCreateCustomDomain = useCreateCustomDomain;
956
- exports.useDeleteCustomDomain = useDeleteCustomDomain;
957
- exports.useFetchCustomDomain = useFetchCustomDomain;
958
- exports.useValidateDomain = useValidateDomain;
959
- //# sourceMappingURL=index-6d441e24.js.map