<?php
    $style = $style ?? 'style-1';
    $author = $post->author;
    $authorDisplayName = $author->getMetaData('display_name', true);
    $category = $post->firstCategory;
?>

<?php if($style === 'style-5'): ?>
    <div class="blog-post-item">
        <div class="blog-post-thumb">
            <?php if($image = $post->image): ?>
                <a href="<?php echo e($post->url); ?>"><img src="<?php echo e(RvMedia::getImageUrl($image, 'small', false, RvMedia::getDefaultImage())); ?>" alt="<?php echo e($post->name); ?>" /></a>
            <?php endif; ?>
            <span class="date"><?php echo e($post->created_at->translatedFormat('M d, Y')); ?></span>
        </div>
        <div class="blog-post-content">
            <?php if($category): ?>
                <a href="<?php echo e($category->url); ?>" class="tag"><?php echo e($category->name); ?></a>
            <?php endif; ?>
            <h2 title="<?php echo e($post->name); ?>" class="title truncate-2-custom">
                <a href="<?php echo e($post->url); ?>"><?php echo e($post->name); ?></a>
            </h2>
            <?php if($description = $post->description): ?>
                <p title="<?php echo e($description); ?>" class="truncate-3-custom"><?php echo BaseHelper::clean(nl2br($description)); ?></p>
            <?php endif; ?>
            <a href="<?php echo e($post->url); ?>" class="link-btn"><?php echo e(__('Read More')); ?> <i class="flaticon-right-arrow"></i></a>
        </div>
    </div>
<?php else: ?>
    <div
        class="<?php echo \Illuminate\Support\Arr::toCssClasses([
            'blog-post-item-four' => $style === 'style-4',
            'blog-post-item-two' => $style !== 'style-4',
        ]); ?>">
        <div class="<?php echo \Illuminate\Support\Arr::toCssClasses([
            'blog-post-thumb-four' => $style === 'style-4',
            'blog-post-thumb-two' => $style !== 'style-4',
        ]); ?>"
        >
            <a href="<?php echo e($post->url); ?>"><img
                    src="<?php echo e(RvMedia::getImageUrl($post->image, 'small', false, RvMedia::getDefaultImage())); ?>"
                    alt="<?php echo e($post->name); ?>" />
            </a>
            <?php if($category && $style !== 'style-4'): ?>
                <a
                    href="<?php echo e($category->url); ?>"
                    class="<?php echo \Illuminate\Support\Arr::toCssClasses(['tag', 'tag-two' => $style === 'style-2']); ?>"
                >
                    <?php echo e($category->name); ?>

                </a>
            <?php endif; ?>
        </div>
        <div class="<?php echo \Illuminate\Support\Arr::toCssClasses([
            'blog-post-content-two' => $style !== 'style-4',
            'blog-post-content-four' => $style === 'style-4'
        ]); ?>"
        >
            <?php if($style === 'style-4'): ?>
                <?php if($category): ?>
                    <a
                        href="<?php echo e($category->url); ?>"
                        class="tag"
                    >
                        <?php echo e($category->name); ?>

                    </a>
                <?php endif; ?>
                <div class="blog-meta-two">
                    <ul class="list-wrap">
                        <li><i class="far fa-calendar"></i><?php echo e($post->created_at->translatedFormat('M d, Y')); ?></li>
                        <?php if($author->exists): ?>
                            <?php if($authorDisplayName): ?>
                                <li>
                                    <i class="far fa-user"></i>
                                    <a href="<?php echo e($post->url); ?>"><?php echo e(__('by :name', ['name' => $authorDisplayName])); ?></a>
                                </li>
                            <?php else: ?>
                                <li>
                                    <i class="far fa-user"></i>
                                    <a href="<?php echo e($post->url); ?>"><?php echo e(__('by :name', ['name' => $authorDisplayName])); ?></a>
                                </li>
                            <?php endif; ?>
                        <?php endif; ?>
                    </ul>
                </div>
            <?php endif; ?>
            <h2
                class="title truncate-2-custom"
                title="<?php echo e($post->name); ?>"
            >
                <a href="<?php echo e($post->url); ?>"><?php echo e($post->name); ?></a>
            </h2>

            <?php if($description = $post->description): ?>
                <p title="<?php echo e($description); ?>" class="truncate-3-custom"><?php echo e($description); ?></p>
            <?php endif; ?>

            <?php if($style !== 'style-4'): ?>
                <div class="blog-meta">
                    <ul class="list-wrap">
                        <?php if($author->exists): ?>
                            <?php if($authorDisplayName): ?>
                                <li>
                                    <span>
                                        <img src="<?php echo e($author->avatar_url); ?>" alt="<?php echo e($authorDisplayName); ?>" />
                                        <?php echo e($authorDisplayName); ?>

                                    </span>
                                </li>
                            <?php else: ?>
                                <li>
                                    <span>
                                        <img src="<?php echo e($author->avatar_url); ?>" alt="<?php echo e($author->name); ?>" />
                                        <?php echo e($author->name); ?>

                                    </span>
                                </li>
                            <?php endif; ?>
                        <?php endif; ?>
                        <li><i class="far fa-calendar"></i><?php echo e($post->created_at->translatedFormat('M d, Y')); ?></li>
                    </ul>
                </div>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>
<?php /**PATH /home/mideatek/technical.globix.ae/platform/themes/gerow/partials/blog/post/item.blade.php ENDPATH**/ ?>