import React, { useState, useRef } from "react"; import { ApiUpdateUserProfile } from "../api/UserProfileApi"; function ProfileUpdate() { const [file, setFile] = useState(null); const [username, setUsername] = useState(""); const [fullName, setFullName] = useState(""); const [about, setAbout] = useState(""); const defaultImage = "https://i1.sndcdn.com/artworks-cTz48e4f1lxn5Ozp-L3hopw-t500x500.jpg"; const fileInputRef = useRef(null); const handleImageUpload = () => { if (fileInputRef.current) { fileInputRef.current.click(); } }; const handleFileChange = e => { const selectedFile = e.target.files[0]; if (selectedFile) { setFile(selectedFile); } }; const handleSave = () => { const formData = new FormData(); formData.append("profile_pic", file); formData.append("first_name", username); formData.append("about", about); ApiUpdateUserProfile(formData); }; return (