diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index c28ff34..2ee5223 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -6,11 +6,7 @@
-
-
-
-
@@ -334,14 +330,6 @@
-
-
- 1740276092528
-
-
-
- 1740276092528
-
1740321721526
@@ -726,7 +714,15 @@
1741487735223
-
+
+
+ 1741492688761
+
+
+
+ 1741492688761
+
+
diff --git a/src/components/input/ToolFileInput.tsx b/src/components/input/ToolFileInput.tsx
index 8665347..10fb064 100644
--- a/src/components/input/ToolFileInput.tsx
+++ b/src/components/input/ToolFileInput.tsx
@@ -80,15 +80,6 @@ export default function ToolFileInput({
}
};
- const handlePaste = (event: ClipboardEvent) => {
- const clipboardItems = event.clipboardData?.items ?? [];
- const item = clipboardItems[0];
- if (item && item.type.includes('image')) {
- const file = item.getAsFile();
- if (file) onChange(file);
- }
- };
-
useEffect(() => {
if (value) {
const objectUrl = URL.createObjectURL(value);
@@ -138,7 +129,6 @@ export default function ToolFileInput({
}
};
- // Handle crop changes from react-image-crop
const handleCropChange = (newCrop: Crop) => {
setCrop(newCrop);
};
@@ -156,12 +146,20 @@ export default function ToolFileInput({
};
useEffect(() => {
+ const handlePaste = (event: ClipboardEvent) => {
+ const clipboardItems = event.clipboardData?.items ?? [];
+ const item = clipboardItems[0];
+ if (item && item.type.includes('image')) {
+ const file = item.getAsFile();
+ if (file) onChange(file);
+ }
+ };
window.addEventListener('paste', handlePaste);
return () => {
window.removeEventListener('paste', handlePaste);
};
- }, [handlePaste]);
+ }, [onChange]);
return (
diff --git a/src/pages/tools/image/png/crop/crop.service.test.ts b/src/pages/tools/image/png/crop/crop.service.test.ts
deleted file mode 100644
index 8516196..0000000
--- a/src/pages/tools/image/png/crop/crop.service.test.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { expect, describe, it } from 'vitest';
-// import { } from './service';
-//
-// describe('crop', () => {
-//
-// })
diff --git a/src/pages/tools/image/png/crop/service.ts b/src/pages/tools/image/png/crop/service.ts
deleted file mode 100644
index e69de29..0000000