<%- include('./partials/header.ejs') %>

<div class="blur-main">
    <div class="phone-top-items d-flex">
        <% if(user) { %><div class="d-inline-block position-absolute end-0 me-5">
            <button class="btn btn-danger">Delete</button>
            <button class="btn btn-warning">Edit</button>
        </div> <% } %>
        <img src="<%= phone.image %>" width="40%" height="40%" alt="<%= phone.name %> Image">
        <div class="info" style="padding-left: 3%;">
            <p class="phone-header fs-2"><%= phone.name %></p>
            <p class="fs-4 info-text">Model: <%= phone.model %></p>
            <p class="fs-4 info-text">Chipset: <%= phone.chipset %></p>
            <p class="fs-4 info-text">Card slot: <%= phone.sdcard ?? 'N/A' %></p>
            <p class="fs-4 info-text">Internal Storage: <%= phone.storage %></p>
            <p class="fs-4 info-text">USB: <%= phone.usb %></p>
            <p class="fs-4 info-text">Battery: <%= phone.battery %></p>
            <p class="fs-4 info-text">Display: <%= phone.display %></p>
            <p class="fs-4 info-text">OS: <%= phone.os %></p>
        </div>
    </div>
    <div class="phone-links">
        <% if(phone.sections) { %>
            <p class="fs-1 phone-header">Links</p>
            <% for(const section in phone.sections) { %>
                <p class="fs-3 phone-header"><%= section %></p>
                <% for(const link in phone.sections[section]) { %>
                    <a href="<%= phone.sections[section][link] %>" class="fs-4 link-primary"><%= link %></a> <br>
                <% } %>
            <% } %>
        <% } %>
    </div>
    <br>
    <div class="phone-part-map">
        <table class="table table-dark table-hover phone-part-map-table fs-5" style="width: fit-content">
            <thead>
                <tr>
                    <th scope="col">Name</th>
                    <th scope="col">Partition</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <th scope="row">audio_dsp</th>
                    <td>/dev/block/sdc3</td>
                </tr>
                <tr>
                    <th scope="row">boot</th>
                    <td>/dev/block/sdc43</td>
                </tr>
                <tr>
                    <th scope="row">boot_para</th>
                    <td>/dev/block/sdc28</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>

<%- include ('./partials/footer.ejs') %>