@payloadcms/plugin-search 3.24.0-canary.4c8cafd → 3.24.0-canary.58e9eb5

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 +1 @@
1
- {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../../src/Search/ui/ReindexButton/index.client.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAOpD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA0I5D,CAAA"}
1
+ {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../../src/Search/ui/ReindexButton/index.client.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAMpD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4I5D,CAAA"}
@@ -1,10 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { LoadingOverlay, Popup, PopupList, toast, useConfig, useLocale, useModal, useTranslation } from '@payloadcms/ui';
3
+ import { ConfirmationModal, Popup, PopupList, toast, useConfig, useLocale, useModal, useTranslation } from '@payloadcms/ui';
4
4
  import { useRouter } from 'next/navigation.js';
5
5
  import React, { useCallback, useMemo, useState } from 'react';
6
6
  import { ReindexButtonLabel } from './ReindexButtonLabel/index.js';
7
- import { ReindexConfirmModal } from './ReindexConfirmModal/index.js';
8
7
  const confirmReindexModalSlug = 'confirm-reindex-modal';
9
8
  export const ReindexButtonClient = ({ collectionLabels, searchCollections, searchSlug })=>{
10
9
  const { closeModal, openModal } = useModal();
@@ -13,28 +12,26 @@ export const ReindexButtonClient = ({ collectionLabels, searchCollections, searc
13
12
  const locale = useLocale();
14
13
  const router = useRouter();
15
14
  const [reindexCollections, setReindexCollections] = useState([]);
16
- const [isLoading, setLoading] = useState(false);
17
15
  const openConfirmModal = useCallback(()=>openModal(confirmReindexModalSlug), [
18
16
  openModal
19
17
  ]);
20
- const closeConfirmModal = useCallback(()=>closeModal(confirmReindexModalSlug), [
21
- closeModal
22
- ]);
23
- const handleReindexSubmit = useCallback(async ()=>{
24
- if (isLoading || !reindexCollections.length) {
18
+ const handleReindexSubmit = useCallback(async ({ closeConfirmationModal, setConfirming })=>{
19
+ if (!reindexCollections.length) {
20
+ setConfirming(false);
21
+ closeConfirmationModal();
25
22
  return;
26
23
  }
27
- closeConfirmModal();
28
- setLoading(true);
29
24
  try {
30
- const endpointRes = await fetch(`${config.routes.api}/${searchSlug}/reindex?locale=${locale.code}`, {
25
+ const res = await fetch(`${config.routes.api}/${searchSlug}/reindex?locale=${locale.code}`, {
31
26
  body: JSON.stringify({
32
27
  collections: reindexCollections
33
28
  }),
34
29
  method: 'POST'
35
30
  });
36
- const { message } = await endpointRes.json();
37
- if (!endpointRes.ok) {
31
+ setConfirming(false);
32
+ closeConfirmationModal();
33
+ const { message } = await res.json();
34
+ if (!res.ok) {
38
35
  toast.error(message);
39
36
  } else {
40
37
  toast.success(message);
@@ -43,12 +40,11 @@ export const ReindexButtonClient = ({ collectionLabels, searchCollections, searc
43
40
  } catch (_err) {
44
41
  // swallow error, toast shown above
45
42
  } finally{
43
+ setConfirming(false);
44
+ closeConfirmationModal();
46
45
  setReindexCollections([]);
47
- setLoading(false);
48
46
  }
49
47
  }, [
50
- closeConfirmModal,
51
- isLoading,
52
48
  reindexCollections,
53
49
  router,
54
50
  searchSlug,
@@ -123,15 +119,11 @@ export const ReindexButtonClient = ({ collectionLabels, searchCollections, searc
123
119
  size: "large",
124
120
  verticalAlign: "bottom"
125
121
  }),
126
- /*#__PURE__*/ _jsx(ReindexConfirmModal, {
127
- description: modalDescription,
128
- onCancel: closeConfirmModal,
129
- onConfirm: handleReindexSubmit,
130
- slug: confirmReindexModalSlug,
131
- title: modalTitle
132
- }),
133
- isLoading && /*#__PURE__*/ _jsx(LoadingOverlay, {
134
- loadingText: loadingText
122
+ /*#__PURE__*/ _jsx(ConfirmationModal, {
123
+ body: modalDescription,
124
+ heading: modalTitle,
125
+ modalSlug: confirmReindexModalSlug,
126
+ onConfirm: handleReindexSubmit
135
127
  })
136
128
  ]
137
129
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/Search/ui/ReindexButton/index.client.tsx"],"sourcesContent":["'use client'\n\nimport {\n LoadingOverlay,\n Popup,\n PopupList,\n toast,\n useConfig,\n useLocale,\n useModal,\n useTranslation,\n} from '@payloadcms/ui'\nimport { useRouter } from 'next/navigation.js'\nimport React, { useCallback, useMemo, useState } from 'react'\n\nimport type { ReindexButtonProps } from './types.js'\n\nimport { ReindexButtonLabel } from './ReindexButtonLabel/index.js'\nimport { ReindexConfirmModal } from './ReindexConfirmModal/index.js'\n\nconst confirmReindexModalSlug = 'confirm-reindex-modal'\n\nexport const ReindexButtonClient: React.FC<ReindexButtonProps> = ({\n collectionLabels,\n searchCollections,\n searchSlug,\n}) => {\n const { closeModal, openModal } = useModal()\n\n const { config } = useConfig()\n\n const {\n i18n: { t },\n } = useTranslation()\n\n const locale = useLocale()\n const router = useRouter()\n\n const [reindexCollections, setReindexCollections] = useState<string[]>([])\n const [isLoading, setLoading] = useState<boolean>(false)\n\n const openConfirmModal = useCallback(() => openModal(confirmReindexModalSlug), [openModal])\n const closeConfirmModal = useCallback(() => closeModal(confirmReindexModalSlug), [closeModal])\n\n const handleReindexSubmit = useCallback(async () => {\n if (isLoading || !reindexCollections.length) {\n return\n }\n\n closeConfirmModal()\n setLoading(true)\n\n try {\n const endpointRes = await fetch(\n `${config.routes.api}/${searchSlug}/reindex?locale=${locale.code}`,\n {\n body: JSON.stringify({\n collections: reindexCollections,\n }),\n method: 'POST',\n },\n )\n\n const { message } = (await endpointRes.json()) as { message: string }\n\n if (!endpointRes.ok) {\n toast.error(message)\n } else {\n toast.success(message)\n router.refresh()\n }\n } catch (_err: unknown) {\n // swallow error, toast shown above\n } finally {\n setReindexCollections([])\n setLoading(false)\n }\n }, [closeConfirmModal, isLoading, reindexCollections, router, searchSlug, locale, config])\n\n const handleShowConfirmModal = useCallback(\n (collections: string | string[] = searchCollections) => {\n setReindexCollections(typeof collections === 'string' ? [collections] : collections)\n openConfirmModal()\n },\n [openConfirmModal, searchCollections],\n )\n\n const handlePopupButtonClick = useCallback(\n (closePopup: () => void, slug?: string) => {\n closePopup()\n handleShowConfirmModal(slug)\n },\n [handleShowConfirmModal],\n )\n\n const getPluralizedLabel = useCallback(\n (slug: string) => {\n const label = collectionLabels[slug]\n if (typeof label === 'string') {\n return label\n } else {\n return Object.hasOwn(label, locale.code) ? label[locale.code] : slug\n }\n },\n [collectionLabels, locale.code],\n )\n\n const pluralizedLabels = useMemo(() => {\n return searchCollections.reduce<Record<string, string>>((acc, slug) => {\n acc[slug] = getPluralizedLabel(slug)\n return acc\n }, {})\n }, [searchCollections, getPluralizedLabel])\n\n const selectedAll = reindexCollections.length === searchCollections.length\n const selectedLabels = reindexCollections.map((slug) => pluralizedLabels[slug]).join(', ')\n\n const modalTitle = selectedAll\n ? t('general:confirmReindexAll')\n : t('general:confirmReindex', { collections: selectedLabels })\n const modalDescription = selectedAll\n ? t('general:confirmReindexDescriptionAll')\n : t('general:confirmReindexDescription', { collections: selectedLabels })\n const loadingText = selectedAll\n ? t('general:reindexingAll', { collections: t('general:collections') })\n : t('general:reindexingAll', { collections: selectedLabels })\n\n return (\n <div>\n <Popup\n button={<ReindexButtonLabel />}\n render={({ close }) => (\n <PopupList.ButtonGroup>\n {searchCollections.map((collectionSlug) => (\n <PopupList.Button\n key={collectionSlug}\n onClick={() => handlePopupButtonClick(close, collectionSlug)}\n >\n {pluralizedLabels[collectionSlug]}\n </PopupList.Button>\n ))}\n <PopupList.Button onClick={() => handlePopupButtonClick(close)}>\n {t('general:allCollections')}\n </PopupList.Button>\n </PopupList.ButtonGroup>\n )}\n showScrollbar\n size=\"large\"\n verticalAlign=\"bottom\"\n />\n <ReindexConfirmModal\n description={modalDescription}\n onCancel={closeConfirmModal}\n onConfirm={handleReindexSubmit}\n slug={confirmReindexModalSlug}\n title={modalTitle}\n />\n {isLoading && <LoadingOverlay loadingText={loadingText} />}\n </div>\n )\n}\n"],"names":["LoadingOverlay","Popup","PopupList","toast","useConfig","useLocale","useModal","useTranslation","useRouter","React","useCallback","useMemo","useState","ReindexButtonLabel","ReindexConfirmModal","confirmReindexModalSlug","ReindexButtonClient","collectionLabels","searchCollections","searchSlug","closeModal","openModal","config","i18n","t","locale","router","reindexCollections","setReindexCollections","isLoading","setLoading","openConfirmModal","closeConfirmModal","handleReindexSubmit","length","endpointRes","fetch","routes","api","code","body","JSON","stringify","collections","method","message","json","ok","error","success","refresh","_err","handleShowConfirmModal","handlePopupButtonClick","closePopup","slug","getPluralizedLabel","label","Object","hasOwn","pluralizedLabels","reduce","acc","selectedAll","selectedLabels","map","join","modalTitle","modalDescription","loadingText","div","button","render","close","ButtonGroup","collectionSlug","Button","onClick","showScrollbar","size","verticalAlign","description","onCancel","onConfirm","title"],"mappings":"AAAA;;AAEA,SACEA,cAAc,EACdC,KAAK,EACLC,SAAS,EACTC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,cAAc,QACT,iBAAgB;AACvB,SAASC,SAAS,QAAQ,qBAAoB;AAC9C,OAAOC,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AAI7D,SAASC,kBAAkB,QAAQ,gCAA+B;AAClE,SAASC,mBAAmB,QAAQ,iCAAgC;AAEpE,MAAMC,0BAA0B;AAEhC,OAAO,MAAMC,sBAAoD,CAAC,EAChEC,gBAAgB,EAChBC,iBAAiB,EACjBC,UAAU,EACX;IACC,MAAM,EAAEC,UAAU,EAAEC,SAAS,EAAE,GAAGf;IAElC,MAAM,EAAEgB,M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OE;8CAE5Cf,gBAAgB,CAACe,eAAe;mCAH5BA;0CAMT,KAACzE,UAAU0E,MAAM;gCAACC,SAAS,IAAMxB,uBAAuBoB;0CACrDjD,EAAE;;;;gBAITsD,aAAa;gBACbC,MAAK;gBACLC,eAAc;;0BAEhB,KAAClE;gBACCmE,aAAab;gBACbc,UAAUlD;gBACVmD,WAAWlD;gBACXsB,MAAMxC;gBACNqE,OAAOjB;;YAERtC,2BAAa,KAAC7B;gBAAeqE,aAAaA;;;;AAGjD,EAAC"}
1
+ {"version":3,"sources":["../../../../src/Search/ui/ReindexButton/index.client.tsx"],"sourcesContent":["'use client'\n\nimport type { OnConfirm } from '@payloadcms/ui'\n\nimport {\n ConfirmationModal,\n Popup,\n PopupList,\n toast,\n useConfig,\n useLocale,\n useModal,\n useTranslation,\n} from '@payloadcms/ui'\nimport { useRouter } from 'next/navigation.js'\nimport React, { useCallback, useMemo, useState } from 'react'\n\nimport type { ReindexButtonProps } from './types.js'\n\nimport { ReindexButtonLabel } from './ReindexButtonLabel/index.js'\n\nconst confirmReindexModalSlug = 'confirm-reindex-modal'\n\nexport const ReindexButtonClient: React.FC<ReindexButtonProps> = ({\n collectionLabels,\n searchCollections,\n searchSlug,\n}) => {\n const { closeModal, openModal } = useModal()\n\n const { config } = useConfig()\n\n const {\n i18n: { t },\n } = useTranslation()\n\n const locale = useLocale()\n const router = useRouter()\n\n const [reindexCollections, setReindexCollections] = useState<string[]>([])\n\n const openConfirmModal = useCallback(() => openModal(confirmReindexModalSlug), [openModal])\n\n const handleReindexSubmit: OnConfirm = useCallback(\n async ({ closeConfirmationModal, setConfirming }) => {\n if (!reindexCollections.length) {\n setConfirming(false)\n closeConfirmationModal()\n return\n }\n\n try {\n const res = await fetch(\n `${config.routes.api}/${searchSlug}/reindex?locale=${locale.code}`,\n {\n body: JSON.stringify({\n collections: reindexCollections,\n }),\n method: 'POST',\n },\n )\n\n setConfirming(false)\n closeConfirmationModal()\n\n const { message } = (await res.json()) as { message: string }\n\n if (!res.ok) {\n toast.error(message)\n } else {\n toast.success(message)\n router.refresh()\n }\n } catch (_err: unknown) {\n // swallow error, toast shown above\n } finally {\n setConfirming(false)\n closeConfirmationModal()\n setReindexCollections([])\n }\n },\n [reindexCollections, router, searchSlug, locale, config],\n )\n\n const handleShowConfirmModal = useCallback(\n (collections: string | string[] = searchCollections) => {\n setReindexCollections(typeof collections === 'string' ? [collections] : collections)\n openConfirmModal()\n },\n [openConfirmModal, searchCollections],\n )\n\n const handlePopupButtonClick = useCallback(\n (closePopup: () => void, slug?: string) => {\n closePopup()\n handleShowConfirmModal(slug)\n },\n [handleShowConfirmModal],\n )\n\n const getPluralizedLabel = useCallback(\n (slug: string) => {\n const label = collectionLabels[slug]\n if (typeof label === 'string') {\n return label\n } else {\n return Object.hasOwn(label, locale.code) ? label[locale.code] : slug\n }\n },\n [collectionLabels, locale.code],\n )\n\n const pluralizedLabels = useMemo(() => {\n return searchCollections.reduce<Record<string, string>>((acc, slug) => {\n acc[slug] = getPluralizedLabel(slug)\n return acc\n }, {})\n }, [searchCollections, getPluralizedLabel])\n\n const selectedAll = reindexCollections.length === searchCollections.length\n const selectedLabels = reindexCollections.map((slug) => pluralizedLabels[slug]).join(', ')\n\n const modalTitle = selectedAll\n ? t('general:confirmReindexAll')\n : t('general:confirmReindex', { collections: selectedLabels })\n const modalDescription = selectedAll\n ? t('general:confirmReindexDescriptionAll')\n : t('general:confirmReindexDescription', { collections: selectedLabels })\n const loadingText = selectedAll\n ? t('general:reindexingAll', { collections: t('general:collections') })\n : t('general:reindexingAll', { collections: selectedLabels })\n\n return (\n <div>\n <Popup\n button={<ReindexButtonLabel />}\n render={({ close }) => (\n <PopupList.ButtonGroup>\n {searchCollections.map((collectionSlug) => (\n <PopupList.Button\n key={collectionSlug}\n onClick={() => handlePopupButtonClick(close, collectionSlug)}\n >\n {pluralizedLabels[collectionSlug]}\n </PopupList.Button>\n ))}\n <PopupList.Button onClick={() => handlePopupButtonClick(close)}>\n {t('general:allCollections')}\n </PopupList.Button>\n </PopupList.ButtonGroup>\n )}\n showScrollbar\n size=\"large\"\n verticalAlign=\"bottom\"\n />\n <ConfirmationModal\n body={modalDescription}\n heading={modalTitle}\n modalSlug={confirmReindexModalSlug}\n onConfirm={handleReindexSubmit}\n />\n </div>\n )\n}\n"],"names":["ConfirmationModal","Popup","PopupList","toast","useConfig","useLocale","useModal","useTranslation","useRouter","React","useCallback","useMemo","useState","ReindexButtonLabel","confirmReindexModalSlug","ReindexButtonClient","collectionLabels","searchCollections","searchSlug","closeModal","openModal","config","i18n","t","locale","router","reindexCollections","setReindexCollections","openConfirmModal","handleReindexSubmit","closeConfirmationModal","setConfirming","length","res","fetch","routes","api","code","body","JSON","stringify","collections","method","message","json","ok","error","success","refresh","_err","handleShowConfirmModal","handlePopupButtonClick","closePopup","slug","getPluralizedLabel","label","Object","hasOwn","pluralizedLabels","reduce","acc","selectedAll","selectedLabels","map","join","modalTitle","modalDescription","loadingText","div","button","render","close","ButtonGroup","collectionSlug","Button","onClick","showScrollbar","size","verticalAlign","heading","modalSlug","onConfirm"],"mappings":"AAAA;;AAIA,SACEA,iBAAiB,EACjBC,KAAK,EACLC,SAAS,EACTC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,cAAc,QACT,iBAAgB;AACvB,SAASC,SAAS,QAAQ,qBAAoB;AAC9C,OAAOC,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AAI7D,SAASC,kBAAkB,QAAQ,gCAA+B;AAElE,MAAMC,0BAA0B;AAEhC,OAAO,MAAMC,sBAAoD,CAAC,EAChEC,gBAAgB,EAChBC,iBAAiB,EACjBC,UAAU,EACX;IACC,MAAM,EAAEC,UAAU,EAAEC,SAAS,EAAE,GAAGd;IAElC,MAAM,EAAEe,MAAM,EAAE,GAAGjB;IAEnB,MAAM,EACJkB,MAAM,EAAEC,CAAC,EAAE,EACZ,GAAGhB;IAEJ,MAAMiB,SAASnB;IACf,M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gBACCsC,MAAM4B;gBACNa,SAASd;gBACTe,WAAWlE;gBACXmE,WAAWpD;;;;AAInB,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-search",
3
- "version": "3.24.0-canary.4c8cafd",
3
+ "version": "3.24.0-canary.58e9eb5",
4
4
  "description": "Search plugin for Payload",
5
5
  "keywords": [
6
6
  "payload",
@@ -49,19 +49,19 @@
49
49
  "dist"
50
50
  ],
51
51
  "dependencies": {
52
- "@payloadcms/next": "3.24.0-canary.4c8cafd",
53
- "@payloadcms/ui": "3.24.0-canary.4c8cafd"
52
+ "@payloadcms/next": "3.24.0-canary.58e9eb5",
53
+ "@payloadcms/ui": "3.24.0-canary.58e9eb5"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/react": "19.0.1",
57
57
  "@types/react-dom": "19.0.1",
58
58
  "@payloadcms/eslint-config": "3.9.0",
59
- "payload": "3.24.0-canary.4c8cafd"
59
+ "payload": "3.24.0-canary.58e9eb5"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
63
63
  "react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
64
- "payload": "3.24.0-canary.4c8cafd"
64
+ "payload": "3.24.0-canary.58e9eb5"
65
65
  },
66
66
  "publishConfig": {
67
67
  "registry": "https://registry.npmjs.org/"
@@ -1,11 +0,0 @@
1
- import './index.scss';
2
- type Props = {
3
- description: string;
4
- onCancel: () => void;
5
- onConfirm: () => void;
6
- slug: string;
7
- title: string;
8
- };
9
- export declare const ReindexConfirmModal: ({ slug, description, onCancel, onConfirm, title }: Props) => import("react").JSX.Element;
10
- export {};
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Search/ui/ReindexButton/ReindexConfirmModal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAA;AAErB,KAAK,KAAK,GAAG;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAID,eAAO,MAAM,mBAAmB,sDAAuD,KAAK,gCAsB3F,CAAA"}
@@ -1,45 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Modal, useTranslation } from '@payloadcms/ui';
3
- import './index.scss';
4
- const baseClass = 'reindex-confirm-modal';
5
- export const ReindexConfirmModal = ({ slug, description, onCancel, onConfirm, title })=>{
6
- const { i18n: { t } } = useTranslation();
7
- return /*#__PURE__*/ _jsx(Modal, {
8
- className: baseClass,
9
- slug: slug,
10
- children: /*#__PURE__*/ _jsxs("div", {
11
- className: `${baseClass}__wrapper`,
12
- children: [
13
- /*#__PURE__*/ _jsxs("div", {
14
- className: `${baseClass}__content`,
15
- children: [
16
- /*#__PURE__*/ _jsx("h1", {
17
- children: title
18
- }),
19
- /*#__PURE__*/ _jsx("p", {
20
- children: description
21
- })
22
- ]
23
- }),
24
- /*#__PURE__*/ _jsxs("div", {
25
- className: `${baseClass}__controls`,
26
- children: [
27
- /*#__PURE__*/ _jsx(Button, {
28
- buttonStyle: "secondary",
29
- onClick: onCancel,
30
- size: "large",
31
- children: t('general:cancel')
32
- }),
33
- /*#__PURE__*/ _jsx(Button, {
34
- onClick: onConfirm,
35
- size: "large",
36
- children: t('general:confirm')
37
- })
38
- ]
39
- })
40
- ]
41
- })
42
- });
43
- };
44
-
45
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/Search/ui/ReindexButton/ReindexConfirmModal/index.tsx"],"sourcesContent":["import { Button, Modal, useTranslation } from '@payloadcms/ui'\n\nimport './index.scss'\n\ntype Props = {\n description: string\n onCancel: () => void\n onConfirm: () => void\n slug: string\n title: string\n}\n\nconst baseClass = 'reindex-confirm-modal'\n\nexport const ReindexConfirmModal = ({ slug, description, onCancel, onConfirm, title }: Props) => {\n const {\n i18n: { t },\n } = useTranslation()\n return (\n <Modal className={baseClass} slug={slug}>\n <div className={`${baseClass}__wrapper`}>\n <div className={`${baseClass}__content`}>\n <h1>{title}</h1>\n <p>{description}</p>\n </div>\n <div className={`${baseClass}__controls`}>\n <Button buttonStyle=\"secondary\" onClick={onCancel} size=\"large\">\n {t('general:cancel')}\n </Button>\n <Button onClick={onConfirm} size=\"large\">\n {t('general:confirm')}\n </Button>\n </div>\n </div>\n </Modal>\n )\n}\n"],"names":["Button","Modal","useTranslation","baseClass","ReindexConfirmModal","slug","description","onCancel","onConfirm","title","i18n","t","className","div","h1","p","buttonStyle","onClick","size"],"mappings":";AAAA,SAASA,MAAM,EAAEC,KAAK,EAAEC,cAAc,QAAQ,iBAAgB;AAE9D,OAAO,eAAc;AAUrB,MAAMC,YAAY;AAElB,OAAO,MAAMC,sBAAsB,CAAC,EAAEC,IAAI,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,KAAK,EAAS;IAC1F,MAAM,EACJC,MAAM,EAAEC,CAAC,EAAE,EACZ,GAAGT;IACJ,qBACE,KAACD;QAAMW,WAAWT;QAAWE,MAAMA;kBACjC,cAAA,MAACQ;YAAID,WAAW,GAAGT,UAAU,SAAS,CAAC;;8BACrC,MAACU;oBAAID,WAAW,GAAGT,UAAU,SAAS,CAAC;;sCACrC,KAACW;sCAAIL;;sCACL,KAACM;sCAAGT;;;;8BAEN,MAACO;oBAAID,WAAW,GAAGT,UAAU,UAAU,CAAC;;sCACtC,KAACH;4BAAOgB,aAAY;4BAAYC,SAASV;4BAAUW,MAAK;sCACrDP,EAAE;;sCAEL,KAACX;4BAAOiB,SAAST;4BAAWU,MAAK;sCAC9BP,EAAE;;;;;;;AAMf,EAAC"}
@@ -1,39 +0,0 @@
1
- @import '~@payloadcms/ui/scss';
2
-
3
- @layer payload-default {
4
- .reindex-confirm-modal {
5
- @include blur-bg;
6
- display: flex;
7
- align-items: center;
8
- justify-content: center;
9
- height: 100%;
10
-
11
- &__wrapper {
12
- z-index: 1;
13
- position: relative;
14
- display: flex;
15
- flex-direction: column;
16
- gap: base(2);
17
- padding: base(2);
18
- }
19
-
20
- &__content {
21
- display: flex;
22
- flex-direction: column;
23
- gap: base(1);
24
-
25
- > * {
26
- margin: 0;
27
- }
28
- }
29
-
30
- &__controls {
31
- display: flex;
32
- gap: base(0.4);
33
-
34
- .btn {
35
- margin: 0;
36
- }
37
- }
38
- }
39
- }