You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
656 B
27 lines
656 B
import React from "react"; |
|
|
|
export default function Upload({ name, value, onChange, label }) { |
|
return ( |
|
<div className="profile-upload d-flex justify-content-center align-items-center mb-3"> |
|
<> |
|
{value === null ? ( |
|
<></> |
|
) : ( |
|
<img |
|
src={ |
|
value.name |
|
? URL.createObjectURL(value) |
|
: window.baseURL + "file/" + value |
|
} |
|
alt={"کاربر"} |
|
/> |
|
)} |
|
<input |
|
type="file" |
|
name={name} |
|
onChange={(e) => onChange(e.target.name, e.target.files[0])} |
|
/> |
|
</> |
|
</div> |
|
); |
|
}
|
|
|