This commit is contained in:
zadit
2025-02-10 08:22:02 +07:00
parent b798b59d07
commit 49f6b37905
6 changed files with 57 additions and 56 deletions

View File

@@ -25,13 +25,6 @@ const Item = ({
const [itemPrice, setItemPrice] = useState(initialPrice);
const fileInputRef = useRef(null);
useEffect(() => {
if(!isBeingEdit) {
setPreviewUrl(imageUrl)
fileInputRef.current.value = null; // Clear the input value
}
}, [isBeingEdit]);
useEffect(() => {
console.log(imageUrl);
console.log(selectedImage);
@@ -120,7 +113,7 @@ const Item = ({
{(isBeingEdit || blank) && (
<div className={styles.overlay} onClick={handleImageClick}>
<span>
{previewUrl ? "Ganti" : "Ganti"}
{previewUrl ? "Click To Change Image" : "Click To Add Image"}
</span>
</div>
)}