{% set has_comment = card.comments_count.data > 0 %}

{% set xpost_class = '' %}

{% set is_xpost = card.crossposting.src is not empty %}

{% if is_xpost %}
    {% set card_label = card.crossposting.label %}
    {% set xpost_class = 'is_xpost_' ~ card.crossposting.src %}
{% else %}
    {% set card_label = card.label %}
{% endif %}


<a href="{{card.link}}" class="w-full flex justify-between items-center rounded-lg group relative {{xpost_class}}">
    <div class="grid grid-cols-[112px_auto] gap-4 items-center">
     
        {% if card.image.sizes.thumbnail.url != '' %}
        <div class="relative">

            <img loading="lazy" fetchpriority="low" class="bg-slate-100 flex-shrink-0 w-28 h-24 rounded-lg object-cover object-center group-hover:opacity-90" src="{{card.image.sizes.thumbnail.url}}"
            alt="" />
    
        </div>

        {% else %}
        <div class="bg-slate-100 flex-shrink-0 w-28 h-24 rounded-lg flex items-center justify-center text-slate-300">
            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-6">
                <path stroke-linecap="round" stroke-linejoin="round" d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
            </svg>
        </div>
        {% endif %}

        <div class="flex flex-col">
            <div class="card_title line-clamp-3 text-lg lg:text-base leading-5 font-medium font-condensed">
                {{card.title|raw}}
            </div>
            <div class="text-xs flex mt-1 text-slate-500">
   
                <span 
                    id="card_pubdate_{{card.id}}" 
                    class="text-slate-500" 
                    x-data="timeAgoComponent({{ card.timestamp ?? 'null' }})" 
                    x-init="updateTime()" 
                    x-text="time">
                </span>

                {% if has_comment %}
                <span class="mx-1"></span>
                <span class="text-slate-500 flex items-center">
                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-3 mr-0.5">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z" />
                      </svg>
                      
                      
                      
                    {{card.comments_count.data}}
                </span>
                {% endif %}
                
            </div>
        </div>
    </div>
</a>