eleven-solutions-common-website-unique-web 6.0.10 → 6.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,6 +27,21 @@ const TaxonomyForm = () => {
27
27
  const [tempTaxonomy, setTempTaxonomy] = useState([]);
28
28
  const [similarTaxonomies, setSimilarTaxonomies] = useState([]);
29
29
  const [isSimilarTaxonomyOpen, setIsSimilarTaxonomyOpen] = useState(true);
30
+ const [allTaxonomies, setAllTaxonomies] = useState([]);
31
+ useEffect(() => {
32
+ const fetchAllTaxonomies = () => __awaiter(void 0, void 0, void 0, function* () {
33
+ try {
34
+ const fetchedTaxonomies = yield fetchTaxonomiessApi();
35
+ if (fetchedTaxonomies && Array.isArray(fetchedTaxonomies)) {
36
+ setAllTaxonomies(fetchedTaxonomies);
37
+ }
38
+ }
39
+ catch (error) {
40
+ console.error("Unable to fetch all taxonomies", error);
41
+ }
42
+ });
43
+ fetchAllTaxonomies();
44
+ }, []);
30
45
  const [editTaxonomyItem, setEditTaxonomyItem] = useState(null);
31
46
  const [editTempTaxonomyItem, setEditTempTaxonomyItem] = useState(null);
32
47
  const [selectedTaxonomyId, setSelectedTaxonomyId] = useState("");
@@ -258,11 +273,10 @@ const TaxonomyForm = () => {
258
273
  handleDeleteClick(id);
259
274
  window.location.href = "/admin/taxinomies";
260
275
  }, 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) &&
261
- !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: () => {
262
- handleEditClick(index, taxonomy.id);
263
- }, 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("button", { type: "button", onClick: () => {
264
- handleAddSubType(index, taxonomy.id);
265
- }, className: "text-gray-500 transition-colors duration-200 dark:hover:text-blue-500 dark:text-gray-300 hover:text-blue-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: "M12 4.5v15m7.5-7.5h-15" }) }) })] }) })), _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: _jsxs("div", { className: "flex justify-between items-center", children: [_jsx("span", { children: taxonomy.value }), taxonomy.parentId !== null && (_jsx("button", { type: "button", className: "text-gray-500 transition-colors duration-200 dark:hover:text-blue-600 dark:text-gray-300 hover:text-blue-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) }))] }) })] }, 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: () => {
276
+ !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) => {
277
+ const isParent = similarTaxonomies.some((t) => t.parentId === taxonomy.id);
278
+ return (_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", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "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: () => handleEditClick(index, taxonomy.id), 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", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "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("button", { type: "button", onClick: () => handleAddSubType(index, taxonomy.id), className: "text-gray-500 transition-colors duration-200 dark:hover:text-blue-500 dark:text-gray-300 hover:text-blue-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) }) })] }) })), _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: _jsxs("div", { className: "flex justify-between items-center", children: [_jsx("span", { children: taxonomy.value }), allTaxonomies.some((item) => item.parentId === taxonomy.id) && (_jsx("button", { type: "button", className: "text-gray-500 transition-colors duration-200 dark:hover:text-blue-600 dark:text-gray-300 hover:text-blue-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) }))] }) })] }, index));
279
+ }) })] }) }), 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: () => {
266
280
  const newTempTaxonomy = [...tempTaxonomy];
267
281
  newTempTaxonomy.splice(index, 1);
268
282
  setTempTaxonomy(newTempTaxonomy);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "6.0.10",
3
+ "version": "6.0.12",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -36,6 +36,23 @@ const TaxonomyForm = () => {
36
36
  const [similarTaxonomies, setSimilarTaxonomies] = useState<any[]>([]);
37
37
  const [isSimilarTaxonomyOpen, setIsSimilarTaxonomyOpen] = useState(true);
38
38
 
39
+ const [allTaxonomies, setAllTaxonomies] = useState<any[]>([]);
40
+
41
+ useEffect(() => {
42
+ const fetchAllTaxonomies = async () => {
43
+ try {
44
+ const fetchedTaxonomies = await fetchTaxonomiessApi();
45
+ if (fetchedTaxonomies && Array.isArray(fetchedTaxonomies)) {
46
+ setAllTaxonomies(fetchedTaxonomies);
47
+ }
48
+ } catch (error) {
49
+ console.error("Unable to fetch all taxonomies", error);
50
+ }
51
+ };
52
+
53
+ fetchAllTaxonomies();
54
+ }, []);
55
+
39
56
  const [editTaxonomyItem, setEditTaxonomyItem] = useState<{
40
57
  id: string;
41
58
  type: string;
@@ -461,7 +478,7 @@ const TaxonomyForm = () => {
461
478
  </tr>
462
479
  </thead>
463
480
  <tbody className="divide-y divide-gray-200">
464
- {similarTaxonomies.map((taxonomy, index) => (
481
+ {/* {similarTaxonomies.map((taxonomy, index) => (
465
482
  <tr key={index}>
466
483
  {similarTaxonomies.some(
467
484
  (taxonomy) => taxonomy.isEdit
@@ -546,31 +563,148 @@ const TaxonomyForm = () => {
546
563
  <div className="flex justify-between items-center">
547
564
  <span>{taxonomy.value}</span>
548
565
 
549
- {taxonomy.parentId !== null && (
550
- <button
551
- type="button"
552
- className="text-gray-500 transition-colors duration-200 dark:hover:text-blue-600 dark:text-gray-300 hover:text-blue-500 focus:outline-none"
566
+ <button
567
+ type="button"
568
+ className="text-gray-500 transition-colors duration-200 dark:hover:text-blue-600 dark:text-gray-300 hover:text-blue-500 focus:outline-none"
569
+ >
570
+ <svg
571
+ xmlns="http://www.w3.org/2000/svg"
572
+ fill="none"
573
+ viewBox="0 0 24 24"
574
+ strokeWidth="1.5"
575
+ stroke="currentColor"
576
+ className="w-5 h-5"
553
577
  >
554
- <svg
555
- xmlns="http://www.w3.org/2000/svg"
556
- fill="none"
557
- viewBox="0 0 24 24"
558
- strokeWidth="1.5"
559
- stroke="currentColor"
560
- className="w-5 h-5"
561
- >
562
- <path
563
- strokeLinecap="round"
564
- strokeLinejoin="round"
565
- d="M19.5 8.25l-7.5 7.5-7.5-7.5"
566
- />
567
- </svg>
568
- </button>
569
- )}
578
+ <path
579
+ strokeLinecap="round"
580
+ strokeLinejoin="round"
581
+ d="M19.5 8.25l-7.5 7.5-7.5-7.5"
582
+ />
583
+ </svg>
584
+ </button>
570
585
  </div>
571
586
  </td>
572
587
  </tr>
573
- ))}
588
+ ))} */}
589
+
590
+ {similarTaxonomies.map((taxonomy, index) => {
591
+ const isParent = similarTaxonomies.some(
592
+ (t) => t.parentId === taxonomy.id
593
+ );
594
+ return (
595
+ <tr key={index}>
596
+ {similarTaxonomies.some(
597
+ (taxonomy) => taxonomy.isEdit
598
+ ) && (
599
+ <td className="px-4 py-4 text-sm whitespace-nowrap">
600
+ <div className="flex items-center gap-x-6">
601
+ <button
602
+ type="button"
603
+ onClick={() => handleDeleteClick(taxonomy.id)}
604
+ className="text-gray-500 transition-colors duration-200 dark:hover:text-red-600 dark:text-gray-300 hover:text-red-500 focus:outline-none"
605
+ >
606
+ <svg
607
+ xmlns="http://www.w3.org/2000/svg"
608
+ fill="none"
609
+ viewBox="0 0 24 24"
610
+ strokeWidth="1.5"
611
+ stroke="currentColor"
612
+ className="w-5 h-5"
613
+ >
614
+ <path
615
+ strokeLinecap="round"
616
+ strokeLinejoin="round"
617
+ 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"
618
+ />
619
+ </svg>
620
+ </button>
621
+
622
+ <button
623
+ type="button"
624
+ onClick={() =>
625
+ handleEditClick(index, taxonomy.id)
626
+ }
627
+ className="text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none"
628
+ >
629
+ <svg
630
+ xmlns="http://www.w3.org/2000/svg"
631
+ fill="none"
632
+ viewBox="0 0 24 24"
633
+ strokeWidth="1.5"
634
+ stroke="currentColor"
635
+ className="w-5 h-5"
636
+ >
637
+ <path
638
+ strokeLinecap="round"
639
+ strokeLinejoin="round"
640
+ 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"
641
+ />
642
+ </svg>
643
+ </button>
644
+
645
+ <button
646
+ type="button"
647
+ onClick={() =>
648
+ handleAddSubType(index, taxonomy.id)
649
+ }
650
+ className="text-gray-500 transition-colors duration-200 dark:hover:text-blue-500 dark:text-gray-300 hover:text-blue-500 focus:outline-none"
651
+ >
652
+ <svg
653
+ xmlns="http://www.w3.org/2000/svg"
654
+ fill="none"
655
+ viewBox="0 0 24 24"
656
+ strokeWidth="1.5"
657
+ stroke="currentColor"
658
+ className="w-5 h-5"
659
+ >
660
+ <path
661
+ strokeLinecap="round"
662
+ strokeLinejoin="round"
663
+ d="M12 4.5v15m7.5-7.5h-15"
664
+ />
665
+ </svg>
666
+ </button>
667
+ </div>
668
+ </td>
669
+ )}
670
+
671
+ <td className="px-4 py-4 text-sm text-gray-500 dark:text-gray-400">
672
+ {taxonomy.code}
673
+ </td>
674
+
675
+ <td className="px-4 py-4 text-sm font-medium text-gray-900 dark:text-white">
676
+ <div className="flex justify-between items-center">
677
+ <span>{taxonomy.value}</span>
678
+
679
+ {/* {isParent && ( */}
680
+ {allTaxonomies.some(
681
+ (item) => item.parentId === taxonomy.id
682
+ ) && (
683
+ <button
684
+ type="button"
685
+ className="text-gray-500 transition-colors duration-200 dark:hover:text-blue-600 dark:text-gray-300 hover:text-blue-500 focus:outline-none"
686
+ >
687
+ <svg
688
+ xmlns="http://www.w3.org/2000/svg"
689
+ fill="none"
690
+ viewBox="0 0 24 24"
691
+ strokeWidth="1.5"
692
+ stroke="currentColor"
693
+ className="w-5 h-5"
694
+ >
695
+ <path
696
+ strokeLinecap="round"
697
+ strokeLinejoin="round"
698
+ d="M19.5 8.25l-7.5 7.5-7.5-7.5"
699
+ />
700
+ </svg>
701
+ </button>
702
+ )}
703
+ </div>
704
+ </td>
705
+ </tr>
706
+ );
707
+ })}
574
708
  </tbody>
575
709
  </table>
576
710
  </div>
@@ -744,27 +878,6 @@ const TaxonomyForm = () => {
744
878
  </button>
745
879
  </div>
746
880
 
747
- {/* <label className="text-gray-900 dark:text-gray-200 font-semibold">
748
- Code
749
- </label>
750
- <input
751
- type="number"
752
- value={newCode}
753
- onChange={(e) => setNewCode(e.target.value)}
754
- placeholder="Enter Code"
755
- className="w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md"
756
- />
757
- <label className="text-gray-900 dark:text-gray-200 font-semibold">
758
- Value
759
- </label>
760
- <input
761
- type="text"
762
- value={newValue}
763
- onChange={(e) => setNewValue(e.target.value)}
764
- placeholder="Enter Value"
765
- className="w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md"
766
- /> */}
767
-
768
881
  {isAddingSubType ? (
769
882
  <>
770
883
  <label className="text-gray-900 dark:text-gray-200 font-semibold">