improve look of popup

This commit is contained in:
Abi Raja 2024-05-29 14:54:50 -04:00
parent 608ba5cc6f
commit 82132d57aa

View File

@ -25,26 +25,28 @@ const EditPopup: React.FC<EditPopupProps> = ({
} }
}, [popupVisible]); }, [popupVisible]);
// useEffect(() => { useEffect(() => {
// if (!popupVisible) { if (!popupVisible) {
// setEditText(""); setEditText("");
// } }
// }, [popupVisible, setEditText]); }, [popupVisible, setEditText]);
if (!popupVisible) return;
return ( return (
<div <div
className="absolute bg-white p-4 border border-gray-300 rounded shadow-lg" className="absolute bg-white p-4 border border-gray-300 rounded shadow-lg w-60"
style={{ top: popupPosition.y, left: popupPosition.x }} style={{ top: popupPosition.y, left: popupPosition.x }}
> >
<Textarea <Textarea
ref={textareaRef} ref={textareaRef}
value={editText} value={editText}
onChange={(e) => setEditText(e.target.value)} onChange={(e) => setEditText(e.target.value)}
placeholder="Edit text" placeholder="Tell the AI what to change about this element..."
/> />
<Button onClick={handleEditSubmit} className="mt-2"> <div className="flex justify-end mt-2">
Submit <Button onClick={handleEditSubmit}>Update</Button>
</Button> </div>
</div> </div>
); );
}; };