diff --git a/src/trash/editorTable.jsx b/src/trash/editorTable.jsx
index 7047f2d..2174b85 100644
--- a/src/trash/editorTable.jsx
+++ b/src/trash/editorTable.jsx
@@ -1,4 +1,4 @@
-import { useEffect, useRef, useState } from "react";
+import { Fragment, useEffect, useRef, useState } from "react";
import {
DndContext,
closestCenter,
@@ -14,13 +14,13 @@ import {
verticalListSortingStrategy,
} from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities";
-import { BiCopy, BiDotsVertical, BiX } from "react-icons/bi";
+import { BiCopy, BiDotsVerticalRounded, BiX } from "react-icons/bi";
import {
DengiButton,
DengiYesOrNoDialog,
LoadingSpinner,
} from "./trash-components";
-import { motion, AnimatePresence } from "motion/react";
+import { motion, AnimatePresence, LayoutGroup } from "motion/react";
import {
BiCheck,
BiPlus,
@@ -145,7 +145,11 @@ const INITIAL_DATA = [
];
function TableInput(props) {
- return props.useinput ? : ;
+ return props.useinput ? (
+
+ ) : (
+
+ );
}
function SortableRow({
@@ -178,7 +182,7 @@ function SortableRow({
ref={setNodeRef}
style={style}
className={`${
- pickmeMode ? "bg-pink-500/35" : "bg-zinc-900"
+ pickmeMode ? "bg-pink-900/35" : "bg-zinc-800/35"
} bg-grain rounded-lg mb-2`}
>
@@ -205,24 +209,24 @@ function SortableRow({
/>
))}
-
+
+
+
+
-
-
-
@@ -388,7 +392,7 @@ export function TableEditor({
// Create new item with unique id
const newItem = {
...itemToDuplicate,
- id: Date.now(), // or use uuid() or any unique id generator
+ id: String(Date.now()), // or use uuid() or any unique id generator
};
// Insert the new item right after the duplicated item
@@ -462,6 +466,9 @@ export function TableEditor({
};
const handlePublish = () => {
if (isLoading) return;
+ Object.keys(updateTimeoutRef.current).forEach((i) => {
+ clearTimeout(updateTimeoutRef.current[i]);
+ });
setUndoItems([]);
setRedoItems([]);
console.log(convertEditorToApi(items));
@@ -483,7 +490,7 @@ export function TableEditor({
};
const { trigger } = useWebHaptics();
- const handleDragOver = (ev) => {
+ const handleDragOver = () => {
trigger([{ duration: 25 }], { intensity: 0.7 });
};
@@ -493,7 +500,7 @@ export function TableEditor({
,
@@ -558,7 +565,7 @@ export function TableEditor({
{columns.map((col, i) => (
- <>
+
- >
+
))}
@@ -599,7 +606,11 @@ export function TableEditor({
0 ? "sync" : "wait"}>
{items.map((item) => (
пусто
@@ -662,13 +673,13 @@ export function TableEditor({
)}
-
+
- удалить всё
+ удалить из бд