eleven-solutions-common-website-unique-web 3.0.37 → 3.0.39
Sign up to get free protection for your applications and to get access to all the features.
@@ -137,17 +137,6 @@ const TaxonomyForm = () => {
|
|
137
137
|
alert("Failed to add/update Taxonomy");
|
138
138
|
}
|
139
139
|
});
|
140
|
-
// useEffect(() => {
|
141
|
-
// const fetchIsMultiple = async () => {
|
142
|
-
// try {
|
143
|
-
// const result = await isMultipleApi(type);
|
144
|
-
// setIsMultiple(typeof result === "boolean");
|
145
|
-
// } catch (error) {
|
146
|
-
// console.error("Error checking if taxonomy is multiple:", error);
|
147
|
-
// }
|
148
|
-
// };
|
149
|
-
// fetchIsMultiple();
|
150
|
-
// }, [type]);
|
151
140
|
useEffect(() => {
|
152
141
|
const fetchIsMultiple = () => __awaiter(void 0, void 0, void 0, function* () {
|
153
142
|
try {
|
@@ -158,17 +147,28 @@ const TaxonomyForm = () => {
|
|
158
147
|
console.error("Error checking if taxonomy is multiple:", error);
|
159
148
|
}
|
160
149
|
});
|
161
|
-
|
162
|
-
if (window.location.pathname === "/taxonomy/taxonomyform") {
|
163
|
-
fetchIsMultiple();
|
164
|
-
}
|
165
|
-
};
|
166
|
-
handleLocationOrTypeChange();
|
167
|
-
window.addEventListener("popstate", handleLocationOrTypeChange);
|
168
|
-
return () => {
|
169
|
-
window.removeEventListener("popstate", handleLocationOrTypeChange);
|
170
|
-
};
|
150
|
+
fetchIsMultiple();
|
171
151
|
}, [type]);
|
152
|
+
// useEffect(() => {
|
153
|
+
// const fetchIsMultiple = async () => {
|
154
|
+
// try {
|
155
|
+
// const result = await isMultipleApi(type);
|
156
|
+
// setIsMultiple(typeof result === "boolean");
|
157
|
+
// } catch (error) {
|
158
|
+
// console.error("Error checking if taxonomy is multiple:", error);
|
159
|
+
// }
|
160
|
+
// };
|
161
|
+
// const handleLocationOrTypeChange = () => {
|
162
|
+
// if (window.location.pathname === "/taxonomy/taxonomyform") {
|
163
|
+
// fetchIsMultiple();
|
164
|
+
// }
|
165
|
+
// };
|
166
|
+
// handleLocationOrTypeChange();
|
167
|
+
// window.addEventListener("popstate", handleLocationOrTypeChange);
|
168
|
+
// return () => {
|
169
|
+
// window.removeEventListener("popstate", handleLocationOrTypeChange);
|
170
|
+
// };
|
171
|
+
// }, [type]);
|
172
172
|
const handleCancelClick = () => {
|
173
173
|
setType("");
|
174
174
|
setCode("");
|
@@ -262,7 +262,7 @@ const TaxonomyForm = () => {
|
|
262
262
|
console.error("Error deleting Taxonomy:", error);
|
263
263
|
}
|
264
264
|
});
|
265
|
-
return (_jsxs("div", { className: `${isEditMode && isMultiple ? "w-full" : "max-w-4xl"} p-6 mx-auto dark:bg-gray-800`, children: [_jsxs("div", { className: `transition duration-300 ${isModalOpen ? "filter blur-sm" : ""}`, children: [_jsx("h1", { className: "text-3xl font-bold text-center text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? "Edit Taxonomy" : "Add Taxonomy" }), _jsx("h1", { className: "text-2xl text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? `Taxonomy Type: ${type}` : "" }),
|
265
|
+
return (_jsxs("div", { className: `${isEditMode && isMultiple ? "w-full" : "max-w-4xl"} p-6 mx-auto dark:bg-gray-800`, children: [_jsxs("div", { className: `transition duration-300 ${isModalOpen ? "filter blur-sm" : ""}`, children: [_jsx("h1", { className: "text-3xl font-bold text-center text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? "Edit Taxonomy" : "Add Taxonomy" }), _jsx("h1", { className: "text-2xl text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? `Taxonomy Type: ${type}` : "" }), _jsxs("form", { children: [!isEditMode && (_jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Type ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: type, onChange: (e) => setType(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Type" })] })), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Code ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: code, onChange: (e) => setCode(e.target.value === "" ? "" : Number(e.target.value)), type: "number", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Code", disabled: similarTaxonomies.some((taxonomy) => taxonomy.isEdit === false) })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Value ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: value, onChange: (e) => setValue(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Value", disabled: similarTaxonomies.some((taxonomy) => taxonomy.isEdit === false) })] }), _jsxs("div", { className: "flex space-x-4 mt-6 justify-between", children: [_jsx("div", { children: isEditMode && (
|
266
266
|
// <div>
|
267
267
|
// {similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (
|
268
268
|
// <button
|
@@ -281,7 +281,7 @@ const TaxonomyForm = () => {
|
|
281
281
|
handleDeleteClick(id);
|
282
282
|
window.location.href = "/admin/taxinomies";
|
283
283
|
}, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: "Delete" })) })) }), _jsxs("div", { className: "flex space-x-4 justify-end", children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("button", { type: "submit", onClick: handleSave, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: isEditMode ? "Save" : "Add" })), !similarTaxonomies.some((taxonomy) => taxonomy.isEdit) &&
|
284
|
-
!isEditMode && (_jsx("button", { type: "submit", onClick: handleSave, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: isEditMode ? "Save" : "Add" })), _jsx("button", { onClick: handleCancelClick, type: "button", className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: "Cancel" })] })] })] })
|
284
|
+
!isEditMode && (_jsx("button", { type: "submit", onClick: handleSave, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: isEditMode ? "Save" : "Add" })), _jsx("button", { onClick: handleCancelClick, type: "button", className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: "Cancel" })] })] })] }), isSimilarTaxonomyOpen && isMultiple && isEditMode && (_jsxs("div", { className: "flex-grow ml-0 mt-4 w-full", children: [_jsx("div", { className: "overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Actions" })), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Code" }), _jsx("th", { className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Value" })] }) }), _jsx("tbody", { className: "divide-y divide-gray-200", children: similarTaxonomies.map((taxonomy, index) => (_jsxs("tr", { children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsxs("div", { className: "flex items-center gap-x-6", children: [_jsx("button", { type: "button", onClick: () => handleDeleteClick(taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }) }), _jsx("button", { type: "button", onClick: () => {
|
285
285
|
handleEditClick(index, taxonomy.id);
|
286
286
|
}, className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" }) }) })] }) })), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-400", children: taxonomy.code }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-900 dark:text-white", children: taxonomy.value })] }, index))) })] }) }), similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("div", { className: "flex space-x-4 mt-6 justify-start", children: _jsxs("button", { type: "button", onClick: handleOpenModal, className: "flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", children: [_jsx(FaPlus, { className: "mr-2 font-medium" }), "Add Multiple Values"] }) }))] })), isEditMode && (_jsx(_Fragment, { children: tempTaxonomy.length > 0 && (_jsxs("div", { className: "flex-grow ml-0 mt-4 w-full", children: [_jsx("div", { className: "overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Edit/Delete" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left text-gray-500 dark:text-gray-400", children: "Code" }), _jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left text-gray-500 dark:text-gray-400", children: "Value" })] }) }), _jsx("tbody", { className: "bg-white divide-y divide-gray-200 dark:bg-gray-800 dark:divide-gray-700", children: [...tempTaxonomy].map((item, index) => (_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsxs("div", { className: "flex items-center gap-x-6", children: [_jsx("button", { type: "button", onClick: () => {
|
287
287
|
const newTempTaxonomy = [...tempTaxonomy];
|
package/package.json
CHANGED
@@ -171,19 +171,6 @@ const TaxonomyForm = () => {
|
|
171
171
|
}
|
172
172
|
};
|
173
173
|
|
174
|
-
// useEffect(() => {
|
175
|
-
// const fetchIsMultiple = async () => {
|
176
|
-
// try {
|
177
|
-
// const result = await isMultipleApi(type);
|
178
|
-
// setIsMultiple(typeof result === "boolean");
|
179
|
-
// } catch (error) {
|
180
|
-
// console.error("Error checking if taxonomy is multiple:", error);
|
181
|
-
// }
|
182
|
-
// };
|
183
|
-
|
184
|
-
// fetchIsMultiple();
|
185
|
-
// }, [type]);
|
186
|
-
|
187
174
|
useEffect(() => {
|
188
175
|
const fetchIsMultiple = async () => {
|
189
176
|
try {
|
@@ -194,20 +181,33 @@ const TaxonomyForm = () => {
|
|
194
181
|
}
|
195
182
|
};
|
196
183
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
184
|
+
fetchIsMultiple();
|
185
|
+
}, [type]);
|
186
|
+
|
187
|
+
// useEffect(() => {
|
188
|
+
// const fetchIsMultiple = async () => {
|
189
|
+
// try {
|
190
|
+
// const result = await isMultipleApi(type);
|
191
|
+
// setIsMultiple(typeof result === "boolean");
|
192
|
+
// } catch (error) {
|
193
|
+
// console.error("Error checking if taxonomy is multiple:", error);
|
194
|
+
// }
|
195
|
+
// };
|
202
196
|
|
203
|
-
|
197
|
+
// const handleLocationOrTypeChange = () => {
|
198
|
+
// if (window.location.pathname === "/taxonomy/taxonomyform") {
|
199
|
+
// fetchIsMultiple();
|
200
|
+
// }
|
201
|
+
// };
|
204
202
|
|
205
|
-
|
203
|
+
// handleLocationOrTypeChange();
|
206
204
|
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
205
|
+
// window.addEventListener("popstate", handleLocationOrTypeChange);
|
206
|
+
|
207
|
+
// return () => {
|
208
|
+
// window.removeEventListener("popstate", handleLocationOrTypeChange);
|
209
|
+
// };
|
210
|
+
// }, [type]);
|
211
211
|
|
212
212
|
const handleCancelClick = () => {
|
213
213
|
setType("");
|
@@ -342,123 +342,123 @@ const TaxonomyForm = () => {
|
|
342
342
|
{isEditMode ? `Taxonomy Type: ${type}` : ""}
|
343
343
|
</h1>
|
344
344
|
|
345
|
-
{!isMultiple && (
|
346
|
-
|
347
|
-
|
348
|
-
<div className="mb-6 w-full">
|
349
|
-
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
350
|
-
Type <span className="text-red-500">*</span>
|
351
|
-
</label>
|
352
|
-
<input
|
353
|
-
required
|
354
|
-
value={type}
|
355
|
-
onChange={(e) => setType(e.target.value)}
|
356
|
-
type="text"
|
357
|
-
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
358
|
-
placeholder="Enter Type"
|
359
|
-
/>
|
360
|
-
</div>
|
361
|
-
)}
|
362
|
-
<div className="mb-6 w-full">
|
363
|
-
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
364
|
-
Code <span className="text-red-500">*</span>
|
365
|
-
</label>
|
366
|
-
<input
|
367
|
-
required
|
368
|
-
value={code}
|
369
|
-
onChange={(e) =>
|
370
|
-
setCode(e.target.value === "" ? "" : Number(e.target.value))
|
371
|
-
}
|
372
|
-
type="number"
|
373
|
-
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
374
|
-
placeholder="Enter Code"
|
375
|
-
disabled={similarTaxonomies.some(
|
376
|
-
(taxonomy) => taxonomy.isEdit === false
|
377
|
-
)}
|
378
|
-
/>
|
379
|
-
</div>
|
345
|
+
{/* {!isMultiple && ( */}
|
346
|
+
<form>
|
347
|
+
{!isEditMode && (
|
380
348
|
<div className="mb-6 w-full">
|
381
349
|
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
382
|
-
|
350
|
+
Type <span className="text-red-500">*</span>
|
383
351
|
</label>
|
384
352
|
<input
|
385
353
|
required
|
386
|
-
value={
|
387
|
-
onChange={(e) =>
|
354
|
+
value={type}
|
355
|
+
onChange={(e) => setType(e.target.value)}
|
388
356
|
type="text"
|
389
357
|
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
390
|
-
placeholder="Enter
|
391
|
-
disabled={similarTaxonomies.some(
|
392
|
-
(taxonomy) => taxonomy.isEdit === false
|
393
|
-
)}
|
358
|
+
placeholder="Enter Type"
|
394
359
|
/>
|
395
360
|
</div>
|
361
|
+
)}
|
362
|
+
<div className="mb-6 w-full">
|
363
|
+
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
364
|
+
Code <span className="text-red-500">*</span>
|
365
|
+
</label>
|
366
|
+
<input
|
367
|
+
required
|
368
|
+
value={code}
|
369
|
+
onChange={(e) =>
|
370
|
+
setCode(e.target.value === "" ? "" : Number(e.target.value))
|
371
|
+
}
|
372
|
+
type="number"
|
373
|
+
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
374
|
+
placeholder="Enter Code"
|
375
|
+
disabled={similarTaxonomies.some(
|
376
|
+
(taxonomy) => taxonomy.isEdit === false
|
377
|
+
)}
|
378
|
+
/>
|
379
|
+
</div>
|
380
|
+
<div className="mb-6 w-full">
|
381
|
+
<label className="text-gray-900 dark:text-gray-200 font-semibold">
|
382
|
+
Value <span className="text-red-500">*</span>
|
383
|
+
</label>
|
384
|
+
<input
|
385
|
+
required
|
386
|
+
value={value}
|
387
|
+
onChange={(e) => setValue(e.target.value)}
|
388
|
+
type="text"
|
389
|
+
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
390
|
+
placeholder="Enter Value"
|
391
|
+
disabled={similarTaxonomies.some(
|
392
|
+
(taxonomy) => taxonomy.isEdit === false
|
393
|
+
)}
|
394
|
+
/>
|
395
|
+
</div>
|
396
396
|
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
<button
|
417
|
-
type="button"
|
418
|
-
onClick={() => {
|
419
|
-
handleDeleteClick(id);
|
420
|
-
window.location.href = "/admin/taxinomies";
|
421
|
-
}}
|
422
|
-
className="px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600"
|
423
|
-
>
|
424
|
-
Delete
|
425
|
-
</button>
|
426
|
-
)}
|
427
|
-
</div>
|
428
|
-
)}
|
429
|
-
</div>
|
430
|
-
|
431
|
-
<div className="flex space-x-4 justify-end">
|
432
|
-
{similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (
|
433
|
-
<button
|
434
|
-
type="submit"
|
435
|
-
onClick={handleSave}
|
436
|
-
className="px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600"
|
437
|
-
>
|
438
|
-
{isEditMode ? "Save" : "Add"}
|
439
|
-
</button>
|
440
|
-
)}
|
441
|
-
{!similarTaxonomies.some((taxonomy) => taxonomy.isEdit) &&
|
442
|
-
!isEditMode && (
|
397
|
+
<div className="flex space-x-4 mt-6 justify-between">
|
398
|
+
<div>
|
399
|
+
{isEditMode && (
|
400
|
+
// <div>
|
401
|
+
// {similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (
|
402
|
+
// <button
|
403
|
+
// type="button"
|
404
|
+
// onClick={() => {
|
405
|
+
// handleDeleteClick(id);
|
406
|
+
// navigate("/admin/taxonomy");
|
407
|
+
// }}
|
408
|
+
// className="px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600"
|
409
|
+
// >
|
410
|
+
// Delete
|
411
|
+
// </button>
|
412
|
+
// )}
|
413
|
+
// </div>
|
414
|
+
<div>
|
415
|
+
{similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (
|
443
416
|
<button
|
444
|
-
type="
|
445
|
-
onClick={
|
417
|
+
type="button"
|
418
|
+
onClick={() => {
|
419
|
+
handleDeleteClick(id);
|
420
|
+
window.location.href = "/admin/taxinomies";
|
421
|
+
}}
|
446
422
|
className="px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600"
|
447
423
|
>
|
448
|
-
|
424
|
+
Delete
|
449
425
|
</button>
|
450
426
|
)}
|
427
|
+
</div>
|
428
|
+
)}
|
429
|
+
</div>
|
430
|
+
|
431
|
+
<div className="flex space-x-4 justify-end">
|
432
|
+
{similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (
|
451
433
|
<button
|
452
|
-
|
453
|
-
|
434
|
+
type="submit"
|
435
|
+
onClick={handleSave}
|
454
436
|
className="px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600"
|
455
437
|
>
|
456
|
-
|
438
|
+
{isEditMode ? "Save" : "Add"}
|
457
439
|
</button>
|
458
|
-
|
440
|
+
)}
|
441
|
+
{!similarTaxonomies.some((taxonomy) => taxonomy.isEdit) &&
|
442
|
+
!isEditMode && (
|
443
|
+
<button
|
444
|
+
type="submit"
|
445
|
+
onClick={handleSave}
|
446
|
+
className="px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600"
|
447
|
+
>
|
448
|
+
{isEditMode ? "Save" : "Add"}
|
449
|
+
</button>
|
450
|
+
)}
|
451
|
+
<button
|
452
|
+
onClick={handleCancelClick}
|
453
|
+
type="button"
|
454
|
+
className="px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600"
|
455
|
+
>
|
456
|
+
Cancel
|
457
|
+
</button>
|
459
458
|
</div>
|
460
|
-
</
|
461
|
-
|
459
|
+
</div>
|
460
|
+
</form>
|
461
|
+
{/* )} */}
|
462
462
|
|
463
463
|
{/* Table for Displaying Similar Taxonomies */}
|
464
464
|
{isSimilarTaxonomyOpen && isMultiple && isEditMode && (
|