<div class="club-chat" data-club-id="<?php echo e($club->id); ?>" data-messages-url="<?php echo e(route($discussionRoutePrefix.'.messages', $club)); ?>" data-post-url="<?php echo e(route($discussionRoutePrefix.'.messages.store', $club)); ?>" data-react-url="<?php echo e(route($discussionRoutePrefix.'.messages.react', [$club, '__ID__'])); ?>" data-user-id="<?php echo e(auth()->id()); ?>">
    <div class="club-chat-header">
        <div>
            <strong><?php echo e($club->name); ?></strong>
            <div class="club-chat-meta"><?php echo e($club->students_count ?? $club->students->count()); ?> members · Patron: <?php echo e($club->patron?->full_name ?? '—'); ?></div>
        </div>
        <a href="<?php echo e(route($discussionRoutePrefix.'.index')); ?>" class="btn btn-outline btn-sm">Back</a>
    </div>

    <div class="club-chat-messages" id="clubChatMessages">
        <?php $__currentLoopData = $messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php echo $__env->make('clubs._message', ['message' => $message, 'allowedEmojis' => $allowedEmojis], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>

    <?php if($club->discussion_enabled): ?>
        <form class="club-chat-compose" id="clubChatForm" method="POST" action="<?php echo e(route($discussionRoutePrefix.'.messages.store', $club)); ?>" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>
            <div class="club-emoji-bar">
                <?php $__currentLoopData = $allowedEmojis; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $emoji): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <button type="button" class="club-emoji-insert" data-emoji="<?php echo e($emoji); ?>"><?php echo e($emoji); ?></button>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
            <div class="club-compose-row">
                <label class="btn btn-outline btn-sm club-attach-btn">
                    📎
                    <input type="file" name="attachment" id="clubAttachment" hidden accept="image/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,audio/*,video/mp4">
                </label>
                <textarea class="input club-message-input" name="body" id="clubMessageBody" rows="2" placeholder="Type a message…"></textarea>
                <button type="submit" class="btn btn-primary">Send</button>
            </div>
            <div id="clubAttachmentName" class="club-attachment-name"></div>
        </form>
    <?php else: ?>
        <div class="club-chat-disabled">Discussions are disabled for this club.</div>
    <?php endif; ?>
</div>

<?php $__env->startPush('scripts'); ?>
    <script src="<?php echo e(asset('js/club-discussion.js')); ?>"></script>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('styles'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('css/club-chat.css')); ?>">
<?php $__env->stopPush(); ?>
<?php /**PATH C:\laragon\www\southend\resources\views/clubs/_discussion.blade.php ENDPATH**/ ?>