{% extends "base.html" %}

{% block content %}
<h1 class="title">User Profile</h1>
<div class="box">
    <div class="media">
        <div class="media-left">
            <figure class="image is-64x64">
                <!-- Placeholder for Discord Avatar -->
                <img src="https://bulma.io/images/placeholders/128x128.png" alt="Image">
            </figure>
        </div>
        <div class="media-content">
            <div class="content">
                <p>
                    <strong>{{ current_user.username }}</strong>
                    <br>
                    Discord ID: {{ current_user.discord_id }}
                </p>
            </div>
        </div>
    </div>
</div>

<div class="box">
    <h2 class="subtitle">Minecraft Account Linking</h2>
    {% if current_user.minecraft_uuid %}
    <div class="notification is-success">
        Linked to Minecraft account: <strong>{{ current_user.minecraft_username }}</strong>
    </div>
    {% else %}
    <div class="notification is-warning">
        Not linked to any Minecraft account.
    </div>
    <p>To link your account, run the following command in-game:</p>
    <br>
    <div class="field has-addons">
        <div class="control is-expanded">
            <input class="input" type="text" value="/link {{ link_code }}" readonly>
        </div>
        <div class="control">
            <button class="button is-info">
                Copy
            </button>
        </div>
    </div>
    <p class="help">This code will expire in 10 minutes.</p>
    {% endif %}
</div>
{% endblock %}