<?php
    $items = $dashboardFeed ?? collect();
?>

<?php if (isset($component)) { $__componentOriginal53747ceb358d30c0105769f8471417f6 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal53747ceb358d30c0105769f8471417f6 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.card','data' => ['class' => 'h-fit']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'h-fit']); ?>
    <div class="mb-3 flex flex-wrap items-start justify-between gap-2">
        <div>
            <h3 class="text-base font-semibold text-slate-900">Company Feed</h3>
            <p class="text-sm text-slate-500">Latest announcements and job posts.</p>
        </div>
    </div>

    <div class="mb-3 flex flex-wrap items-center gap-4 border-b border-slate-200 pb-2 text-sm text-slate-700">
        <a href="<?php echo e(route('announcements.create')); ?>" class="relative inline-flex items-center gap-2 pb-2 font-medium text-slate-700 hover:text-slate-900">
            <i class="bi bi-pencil-square text-base text-[#B7A4E0]"></i>
            <span>Post</span>
            <span class="absolute inset-x-0 -bottom-2 h-0.5 rounded-full bg-sky-500"></span>
        </a>
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(auth()->user()->hasPermission('recruitment_create')): ?>
            <a href="<?php echo e(route('job-postings.create')); ?>" class="inline-flex items-center gap-2 pb-2 font-medium text-slate-700 hover:text-slate-900">
                <i class="bi bi-sliders text-base text-[#8FA98F]"></i>
                <span>Jobs</span>
            </a>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        <a href="<?php echo e(route('announcements.index')); ?>" class="inline-flex items-center gap-2 pb-2 font-medium text-slate-700 hover:text-slate-900">
            <i class="bi bi-award text-base text-[#C9B08B]"></i>
            <span>Announcements</span>
        </a>
        <a href="<?php echo e(route('job-postings.index')); ?>" class="inline-flex items-center gap-2 pb-2 font-medium text-slate-700 hover:text-slate-900">
            <i class="bi bi-briefcase text-base text-[#7EB6D9]"></i>
            <span>Job Posts</span>
        </a>
    </div>

    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($items->isEmpty()): ?>
        <div class="rounded-lg border border-dashed border-slate-300 p-5 text-center text-sm text-slate-500">
            No feed posts yet.
        </div>
    <?php else: ?>
        <div class="hide-scrollbar space-y-3 xl:max-h-[calc(100vh-15rem)] xl:overflow-y-auto xl:pr-1">
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <article class="rounded-xl border border-slate-200 bg-white p-3">
                    <div class="mb-3 flex flex-wrap items-center justify-between gap-2">
                        <div class="flex flex-wrap items-center gap-2">
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($item['type'] === 'announcement'): ?>
                                <span class="inline-flex items-center rounded-full bg-primary-light px-2 py-0.5 text-xs font-medium text-primary">Announcement</span>
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($item['is_pinned'])): ?>
                                    <span class="inline-flex items-center rounded-full bg-amber-100 px-2 py-0.5 text-xs font-medium text-amber-800">Pinned</span>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            <?php else: ?>
                                <span class="inline-flex items-center rounded-full bg-sky-100 px-2 py-0.5 text-xs font-medium text-sky-800">Job Post</span>
                                <span class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium <?php echo e(($item['status'] ?? '') === 'active' ? 'bg-emerald-100 text-emerald-700' : 'bg-slate-100 text-slate-700'); ?>">
                                    <?php echo e(ucfirst((string) ($item['status'] ?? 'unknown'))); ?>

                                </span>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </div>
                        <span class="text-xs text-slate-500">
                            <?php echo e(optional($item['created_at'])->diffForHumans()); ?>

                        </span>
                    </div>

                    <h4 class="text-sm font-semibold text-slate-900"><?php echo e($item['title'] ?? 'Untitled'); ?></h4>
                    <p class="mt-1 text-xs text-slate-500">Posted by    <?php echo e($item['author'] ?? 'System'); ?></p>

                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($item['type'] === 'announcement'): ?>
                    <?php $attachments = $item['attachments'] ?? collect(); ?>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($attachments->isNotEmpty()): ?>
                            <div class="mt-3" x-data="{ active: 0 }">
                                <!-- Slider -->
                                <div class="relative overflow-hidden rounded group">
                                    <div class="flex transition-transform duration-300" :style="'transform: translateX(-' + (active * 100) + '%)'">
                                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $attachments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attachment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php $url = route('announcements.attachments.download', $attachment); ?>
                                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($attachment->isImage()): ?>
                                                <a href="<?php echo e($url); ?>" target="_blank" class="w-full flex-shrink-0 block">
                                                    <img src="<?php echo e($url); ?>" alt="<?php echo e($attachment->original_name); ?>" class="w-full h-40 object-cover rounded">
                                                </a>
                                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                    </div>
                                    <!-- Left Button -->
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($attachments->count() > 1): ?>
                                        <button @click="active = active > 0 ? active - 1 : 0" class="absolute left-1 top-1/2 -translate-y-1/2 text-dark px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition duration-200">
                                            <i class="bi bi-caret-left-fill"></i>
                                        </button>
                                        <!-- Right Button -->
                                        <button @click="active = active < <?php echo e($attachments->count() - 1); ?> ? active + 1 : active" class="absolute right-1 top-1/2 -translate-y-1/2 text-dark px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition duration-200">
                                            <i class="bi bi-caret-right-fill"></i>
                                        </button>
                                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                </div>
                                <!-- Dots -->
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($attachments->count() > 1): ?>
                                    <div class="flex justify-center gap-2 mt-2">
                                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $attachments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $attachment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <span 
                                                @click="active = <?php echo e($index); ?>"
                                                :class="active === <?php echo e($index); ?> ? 'bg-primary' : 'bg-gray-300'"
                                                class="w-2 h-2 rounded-full cursor-pointer">
                                            </span>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                    </div>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </div>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($item['body'])): ?>
                            <div x-data="{ expanded: false }" class="mt-3">
                                <div class="prose prose-sm max-w-none text-slate-700 text-xs">
                                    <!-- Short text -->
                                    <div x-show="!expanded"><?php echo e(\Illuminate\Support\Str::limit(strip_tags((string) $item['body']), 140)); ?></div>
                                    <!-- Full text -->
                                    <div x-show="expanded"><?php echo $item['body']; ?></div>
                                </div>
                                <!-- Button -->
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(strlen(strip_tags((string) $item['body'])) > 140): ?>
                                    <div class="flex justify-start">
                                        <button @click="expanded = !expanded" class="mt-1 text-xs font-medium text-primary hover:underline">
                                            <span x-text="expanded ? 'Show less' : 'Read more'"></span>
                                        </button>
                                    </div>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </div>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        
                    <?php else: ?>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($item['body'])): ?>
                            <div x-data="{ expanded: false }" class="mt-3">

                                <div x-show="!expanded" class="text-xs text-slate-700">
                                    <?php echo e(\Illuminate\Support\Str::limit(strip_tags((string) $item['body']), 140)); ?>

                                </div>

                                <div x-show="expanded" class="text-xs    text-slate-700">
                                    <?php echo $item['body']; ?>

                                </div>

                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(strlen(strip_tags((string) $item['body'])) > 140): ?>
                                    <button
                                        @click="expanded = !expanded"
                                        class="mt-2 text-primary text-xs font-medium hover:underline"
                                        x-text="expanded ? 'Show Less' : 'Read More'">
                                    </button>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                            </div>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        <div class="mt-3 flex flex-wrap items-center gap-3 text-xs text-slate-500">
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($item['location'])): ?><span><i class="bi bi-geo-alt me-1"></i><?php echo e($item['location']); ?></span><?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($item['employment_type'])): ?><span><i class="bi bi-clock me-1"></i><?php echo e(ucfirst((string) $item['employment_type'])); ?></span><?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            <span><i class="bi bi-people me-1"></i><?php echo e((int) ($item['openings'] ?? 0)); ?> openings</span>
                        </div>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                    <div class="mt-3">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($item['edit_url']) && $item['type'] === 'job_post' && auth()->user()->hasPermission('recruitment_edit')): ?>
                            <a href="<?php echo e($item['edit_url']); ?>" class="text-xs font-medium text-primary hover:underline">Open Job Post</a>
                        <?php else: ?>
                            <a href="<?php echo e($item['index_url'] ?? '#'); ?>" class="text-xs font-medium text-primary hover:underline">Open <?php echo e(ucwords(str_replace('_', ' ', $item['type'] ?? 'announcement'))); ?></a>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </div>
                </article>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal53747ceb358d30c0105769f8471417f6)): ?>
<?php $attributes = $__attributesOriginal53747ceb358d30c0105769f8471417f6; ?>
<?php unset($__attributesOriginal53747ceb358d30c0105769f8471417f6); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal53747ceb358d30c0105769f8471417f6)): ?>
<?php $component = $__componentOriginal53747ceb358d30c0105769f8471417f6; ?>
<?php unset($__componentOriginal53747ceb358d30c0105769f8471417f6); ?>
<?php endif; ?>
<?php /**PATH /var/www/html/kiyohr/v2_version/resources/views/dashboard/partials/mixed-feed.blade.php ENDPATH**/ ?>