<link rel="stylesheet" href="/css/user_profile.css">

<img src="<%= user.avatar %>" alt="<%= user.name %>" width="100">



<% if(user.id == profile_user.id){ %>
    <!-- if user matches then show the form -->
    <form action="/users/update/<%= profile_user.id %>" enctype="multipart/form-data" method="POST">
        <input type="text" name="name" placeholder="Your Name" value="<%= profile_user.name %>" required>
        <input type="email" name="email" placeholder="Your Email" value="<%= profile_user.email %>" required>

        <input type="file" name="avatar" placeholder="Profile Picture">
        <input type="submit"  value="Update">
    </form>
    
<%}else{%>    
    <!-- else show only the profile info -->
    <p><%= profile_user.name %></p>
    <p><%= profile_user.email %></p>
<%} %>
