<!--This is where we will place the type filters when we are ready for that-->

<div class="flex-1 basis-full space-y-3 md:basis-2/3 lg:basis-3/4">

    <!--This is where we will place the upper menu when we are ready for that-->

    <!-- Files -->
    <% if (usersDataObj.data.length == 0) { %>
        <p class="text-orange-700 dark:text-orange-400 pl-5">Looks like you have no files!<br/>
            Upload some to see some action here.</p>
    <% } else { %>
        <div id="appendItems" class=" flex flex-row flex-wrap justify-center gap-3 pt-3 lg:gap-4"></div>
        <div id="loading" class="pt-4 flex flex-nowrap justify-center"></div>
    <% } %>
    <!-- End Files -->
</div>

<iframe src="" id="HiddenFrame" class="hidden w-0 h-0"></iframe>

<!-- Copy Link & Delete Item Button Logic -->
<script>
    function copyLink(itemId) {
        const itemLink = <%= assSecure  %> ? `https://<%= assDomain  %>/${itemId}` : `http://<%= assDomain  %>/${itemId}`
        navigator.clipboard.writeText(itemLink)
    }
    
    function deleteItem(itemId, deleteId) {
        const itemDeleteLink = <%= assSecure  %> ? `https://<%= assDomain  %>/${itemId}/delete/${deleteId}` : `http://<%= assDomain  %>/${itemId}/delete/${deleteId}`
        document.getElementById("HiddenFrame").src=itemDeleteLink
        // After setting our invisible iframe to the delete url, we make sure to give ass time to deletr the file then reset iframe and reload page
        setTimeout(function() {
            document.getElementById("HiddenFrame").src=''
            document.location.reload()
        }, 250)
    }
</script>

<% if (usersDataObj.data.length > 0) { %>
<%- include("./filemanager/infinite-scroll/logic-js") %>
<% } %>