<?php
    $iftaUi = [
        'ps' => ['title' => 'شرعي مسايل، پوښتنې او لارښوونې', 'intro' => 'پوښتنې او د کارن ځوابونه د ادارې تر کتنې وروسته خپرېږي؛ رسمي ځوابونه سمدستي ښکاره کېږي.', 'samples' => 'نمونه پوښتنې', 'latest' => 'وروستۍ مسئلې', 'search' => 'لټون...', 'ask' => 'مسئله وپوښتئ', 'ask_title' => 'خپله پوښتنه وليکئ', 'login_note' => 'د پوښتنې او ځواب لپاره حساب ته ننوځئ.', 'title_label' => 'عنوان', 'category' => 'کتګوري', 'body' => 'پوښتنه', 'submit' => 'د کتنې لپاره ثبت کړئ', 'reply' => 'ځواب وليکئ', 'reply_submit' => 'ځواب ولېږئ', 'official' => 'رسمي ځواب', 'no_questions' => 'تر اوسه پوښتنه نه ده خپره شوې.', 'statuses' => ['pending' => 'د کتنې لاندې', 'open' => 'پرانيستې', 'answered' => 'ځواب شوې', 'closed' => 'تړل شوې']],
        'fa' => ['title' => 'مسائل شرعی، پرسش‌ها و رهنمودها', 'intro' => 'پرسش‌ها و پاسخ‌های کاربران پس از بررسی اداره نشر می‌شود؛ پاسخ رسمی فوری نمایش داده می‌شود.', 'samples' => 'پرسش‌های نمونه', 'latest' => 'مسائل تازه', 'search' => 'جستجو...', 'ask' => 'مسئله بپرسید', 'ask_title' => 'پرسش خود را بنویسید', 'login_note' => 'برای پرسش و پاسخ وارد حساب شوید.', 'title_label' => 'عنوان', 'category' => 'کتگوری', 'body' => 'پرسش', 'submit' => 'ارسال برای بررسی', 'reply' => 'پاسخ بنویسید', 'reply_submit' => 'ارسال پاسخ', 'official' => 'پاسخ رسمی', 'no_questions' => 'هنوز پرسشی نشر نشده است.', 'statuses' => ['pending' => 'در حال بررسی', 'open' => 'باز', 'answered' => 'پاسخ‌شده', 'closed' => 'بسته']],
        'ar' => ['title' => 'مسائل شرعية وأسئلة وإرشادات', 'intro' => 'تنشر أسئلة المستخدمين وردودهم بعد مراجعة الإدارة؛ أما الجواب الرسمي فيظهر مباشرة.', 'samples' => 'أسئلة نموذجية', 'latest' => 'أحدث المسائل', 'search' => 'بحث...', 'ask' => 'اسأل مسألة', 'ask_title' => 'اكتب سؤالك', 'login_note' => 'سجل الدخول للسؤال والرد.', 'title_label' => 'العنوان', 'category' => 'القسم', 'body' => 'السؤال', 'submit' => 'إرسال للمراجعة', 'reply' => 'اكتب ردا', 'reply_submit' => 'إرسال الرد', 'official' => 'جواب رسمي', 'no_questions' => 'لم ينشر أي سؤال بعد.', 'statuses' => ['pending' => 'قيد المراجعة', 'open' => 'مفتوح', 'answered' => 'مجاب', 'closed' => 'مغلق']],
        'en' => ['title' => 'Sharia questions, answers, and guidance', 'intro' => 'User questions and community replies are published after admin review; official answers appear immediately.', 'samples' => 'Sample questions', 'latest' => 'Latest issues', 'search' => 'Search...', 'ask' => 'Ask a question', 'ask_title' => 'Write your question', 'login_note' => 'Login to ask or reply.', 'title_label' => 'Title', 'category' => 'Category', 'body' => 'Question', 'submit' => 'Submit for review', 'reply' => 'Write a reply', 'reply_submit' => 'Send reply', 'official' => 'Official answer', 'no_questions' => 'No questions have been posted yet.', 'statuses' => ['pending' => 'Under review', 'open' => 'Open', 'answered' => 'Answered', 'closed' => 'Closed']],
    ][$currentLocale ?? 'ps'];
?>

<?php $__env->startSection('title', 'دارالافتاء | ' . $ui['brand']); ?>

<?php $__env->startSection('content'); ?>
    <section class="page-hero">
        <div class="container page-hero__grid">
            <div>
                <span class="section-kicker">دارالافتاء</span>
                <h1><?php echo e($iftaUi['title']); ?></h1>
                <p><?php echo e($iftaUi['intro']); ?></p>
            </div>
            <figure class="page-hero__media">
                <img src="<?php echo e(asset('images/madrasa/optimized/gathering.jpg')); ?>" alt="<?php echo e($iftaUi['title']); ?>">
            </figure>
        </div>
    </section>

    <section class="section-pad">
        <div class="container ifta-grid">
            <div class="fatwa-panel">
                <div class="section-heading section-heading--compact">
                    <div>
                        <span class="section-kicker"><?php echo e($iftaUi['samples']); ?></span>
                        <h2><?php echo e($iftaUi['latest']); ?></h2>
                    </div>
                    <label class="search-box">
                        <span class="sr-only"><?php echo e($iftaUi['search']); ?></span>
                        <input type="search" placeholder="<?php echo e($iftaUi['search']); ?>" data-filter-input data-filter-target=".question-list a">
                    </label>
                </div>

                <div class="question-list">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $fatwas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $fatwa): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                        <a href="#" data-filter-text="<?php echo e($fatwa['title']); ?> <?php echo e($fatwa['category']); ?>">
                            <span><?php echo e($fatwa['category']); ?></span>
                            <strong><?php echo e($fatwa['title']); ?></strong>
                            <small><?php echo e($fatwa['date']); ?></small>
                        </a>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                </div>
            </div>

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(auth()->guard()->check()): ?>
                <form class="form-panel" method="post" action="<?php echo e(route('questions.store')); ?>">
                    <?php echo csrf_field(); ?>
                    <span class="section-kicker"><?php echo e($iftaUi['ask']); ?></span>
                    <h2><?php echo e($iftaUi['ask_title']); ?></h2>
                    <label>
                        <span><?php echo e($iftaUi['title_label']); ?></span>
                        <input name="title" value="<?php echo e(old('title')); ?>" required>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['title'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <small><?php echo e($message); ?></small> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </label>
                    <label>
                        <span><?php echo e($iftaUi['category']); ?></span>
                        <input name="category" value="<?php echo e(old('category', 'general')); ?>" required>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['category'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <small><?php echo e($message); ?></small> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </label>
                    <label>
                        <span><?php echo e($iftaUi['body']); ?></span>
                        <textarea name="body" rows="7" required><?php echo e(old('body')); ?></textarea>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['body'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <small><?php echo e($message); ?></small> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </label>
                    <button class="btn btn-primary" type="submit"><i data-lucide="send" aria-hidden="true"></i> <?php echo e($iftaUi['submit']); ?></button>
                </form>
            <?php else: ?>
                <div class="form-panel">
                    <span class="section-kicker"><?php echo e($iftaUi['ask']); ?></span>
                    <h2><?php echo e($iftaUi['login_note']); ?></h2>
                    <a class="btn btn-primary" href="<?php echo e(route('login')); ?>"><i data-lucide="log-in" aria-hidden="true"></i> <?php echo e($ui['login']); ?></a>
                    <a class="auth-link" href="<?php echo e(route('register')); ?>"><?php echo e($ui['register']); ?></a>
                </div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </div>
    </section>

    <section class="section-pad section-pad--light">
        <div class="container ifta-thread-list">
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $questions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $question): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                <article class="ifta-thread">
                    <div class="ifta-thread__head">
                        <span><?php echo e($question->category); ?> · <?php echo e($iftaUi['statuses'][$question->status] ?? $question->status); ?></span>
                        <h2><?php echo e($question->title); ?></h2>
                        <p><?php echo e($question->body); ?></p>
                        <small><?php echo e($question->user->name); ?> · <?php echo e($question->created_at->diffForHumans()); ?></small>
                    </div>

                    <div class="reply-thread">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $question->replies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $reply): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                            <div class="reply-item <?php if($reply->is_official): ?> is-official <?php endif; ?>">
                                <strong><?php echo e($reply->user->name); ?> <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($reply->is_official): ?> · <?php echo e($iftaUi['official']); ?> <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?></strong>
                                <p><?php echo e($reply->body); ?></p>
                            </div>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                    </div>

                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(auth()->guard()->check()): ?>
                        <form class="reply-form" method="post" action="<?php echo e(route('questions.replies.store', $question)); ?>">
                            <?php echo csrf_field(); ?>
                            <label>
                                <span><?php echo e($iftaUi['reply']); ?></span>
                                <textarea name="body" rows="3" required></textarea>
                            </label>
                            <button class="btn btn-ghost" type="submit"><?php echo e($iftaUi['reply_submit']); ?></button>
                        </form>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </article>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                <div class="ifta-thread"><?php echo e($iftaUi['no_questions']); ?></div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

            <?php echo e($questions->links()); ?>

        </div>
    </section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('site.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Applications/MAMP/htdocs/jrk-website/resources/views/site/darul-ifta.blade.php ENDPATH**/ ?>