<link rel="stylesheet" href="{$theme}/assets/css/wall_custom.css">
<div class="wall-wrapper">

    <!-- Заголовок стены -->
    <div class="wall-header">
        <h1>{$widgetData.title}</h1>
        <p class="description">{$widgetData.description}</p>
        <div class="d-flex justify-content-between align-items-center">
            <span class="followers">
                <span id="followersCount">{$widgetData.followersCount}</span> подписчиков
            </span>

            {if $widgetData.usrToken }
                {if $widgetData.isOwner === false }
                    <button class="btn btn-outline-primary btn-subscribe" id="subscribeBtn">
                        Подписаться
                    </button>
                {/if}
            {/if}

        </div>
    </div>

    <input type="hidden" id="wall_id" value="{$widgetData.id}">

    {if !empty($widgetData.usrToken) }
        <!-- Форма нового поста -->
        <div class="post-card mb-4">
            <div class="d-flex mb-3">
                <img src="{$widgetData.usrAvatar}" class="rounded-circle me-2" alt="User" width="40" height="40">
                <input type="text" id="postContent" class="form-control" placeholder="Что у вас нового?" />
            </div>

            <input class="form-control mb-2" type="file" id="postMedia" multiple accept="image/*,video/*">

            <div class="text-end">
                <button class="btn btn-primary px-4" id="submitPost">Опубликовать</button>
            </div>
        </div>
    {/if}


    <!-- Список постов -->
    <div id="postsContainer">
        <!-- Посты будут добавлены через JS -->
    </div>

</div>

<div id="post-modal" class="modal fade" tabindex="-1">
    <div class="modal-dialog modal-dialog-scrollable modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Публикация</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
            </div>
            <div class="modal-body" style="padding-bottom: 100px;">
                <div id="modal-post-container"></div>
            </div>

            <div class="modal-footer py-3 px-4 border-top">
                <div class="container-fluid">
                    <div class="d-flex gap-2">
                        <textarea class="form-control mb-2" id="new-comment-text" rows="2" placeholder="Напишите комментарий..."></textarea>
                        <button class="btn btn-primary btn-sm comment-send" id="add-comment">Отправить</button>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>


<script src="{$theme}/assets/widgets/walls.js"></script>