ok
This commit is contained in:
@@ -5,6 +5,7 @@ const Item = ({
|
||||
forCart,
|
||||
forInvoice,
|
||||
name: initialName,
|
||||
description: initialDescription,
|
||||
price: initialPrice,
|
||||
qty: initialQty,
|
||||
imageUrl,
|
||||
@@ -23,6 +24,7 @@ const Item = ({
|
||||
const [itemQty, setItemQty] = useState(blank ? 0 : initialQty);
|
||||
const [itemName, setItemName] = useState(initialName);
|
||||
const [itemPrice, setItemPrice] = useState(initialPrice);
|
||||
const [itemDescription, setItemDescription] = useState(initialDescription);
|
||||
const fileInputRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -89,6 +91,7 @@ const Item = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={`${styles.item} ${forInvoice ? styles.itemInvoice : ""}`}>
|
||||
{!forInvoice && (
|
||||
<div className={styles.imageContainer}>
|
||||
@@ -113,7 +116,7 @@ const Item = ({
|
||||
{(isBeingEdit || blank) && (
|
||||
<div className={styles.overlay} onClick={handleImageClick}>
|
||||
<span>
|
||||
{previewUrl ? "Click To Change Image" : "Click To Add Image"}
|
||||
{previewUrl ? "Ganti gambar" : "Tambah gambar"}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
@@ -153,7 +156,7 @@ const Item = ({
|
||||
!isAvailable ? styles.disabled : ""
|
||||
}`}
|
||||
value={itemName}
|
||||
placeholder="name"
|
||||
placeholder="Nama item"
|
||||
onChange={handleNameChange}
|
||||
disabled={!blank && !isBeingEdit}
|
||||
/>
|
||||
@@ -170,7 +173,7 @@ const Item = ({
|
||||
isBeingEdit || blank ? styles.blank : styles.notblank
|
||||
} ${!isAvailable ? styles.disabled : ""}`}
|
||||
value={itemPrice}
|
||||
placeholder="price"
|
||||
placeholder="Harga"
|
||||
onChange={handlePriceChange}
|
||||
disabled={!blank && !isBeingEdit}
|
||||
/>
|
||||
@@ -242,7 +245,7 @@ const Item = ({
|
||||
}}
|
||||
onClick={isBeingEdit ? handleUpdate : handleCreate}
|
||||
>
|
||||
{isBeingEdit ? "save" : "+"}
|
||||
{isBeingEdit ? "Simpan" : "Buat"}
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
@@ -262,6 +265,12 @@ const Item = ({
|
||||
</button>
|
||||
)} */}
|
||||
</div>
|
||||
{itemDescription?.length &&
|
||||
<div>
|
||||
<p style={{color: '#5f5f5f', fontSize: '3.2vw', padding: '5px'}}>{itemDescription}</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user