{# # MOLECULE: PROMPTLY CARD (vue grille) # Paramètre : item {prompt, favorited, isOwner} #} {% set prompt = item.prompt %} {% set category = prompt.categoryData %} {% set cardColor = category ? category.colorHex : '#6366F1' %} {% set cardIcon = category ? category.icon : 'magic-stick' %} {% set authorFN = prompt.author.firstName ?? '' %} {% set authorLN = prompt.author.lastName ?? '' %} {% set initials = (authorFN[0] ?? '')|upper ~ (authorLN[0] ?? '')|upper %} {% set fieldCount = prompt.fieldCount %} {# Bouton favori — haut droite #} {# Ligne 1 : icône catégorie + titre + auteur — pr-10 réserve l'espace du bouton cœur #}
{% include '_atoms/icon/icon.html.twig' with { name: cardIcon, size: 'xl', color: 'current' } only %}

{{ prompt.title }}

{% if prompt.author.isAdmin() %} {% include '_atoms/logo/logo.html.twig' with { variant: 'simple', size: 'fluid', class: 'w-3 h-3 opacity-40' } only %} Bubul {% else %} {{ (authorFN ~ ' ' ~ authorLN)|trim }} {% endif %}
{# Description #}

{{ prompt.description ?: prompt.cleanPreview(160) }}

{# Footer stats #}
{% include '_atoms/icon/icon.html.twig' with { name: 'chart', size: 'sm', color: 'current' } only %} {{ prompt.usesCount }} {% include '_atoms/icon/icon.html.twig' with { name: 'heart', size: 'sm', color: 'current' } only %} {{ item.favoritesCount ?? 0 }} {% if prompt.aiModelLabel %} {{ prompt.aiModelLabel }} {% endif %} {# Date : màj si disponible, sinon création #} {% if prompt.updatedAt %} {% include '_atoms/icon/icon.html.twig' with { name: 'refresh', size: 'xs', color: 'current' } only %} Màj {{ prompt.updatedAt|date('d/m/y') }} {% else %} {% include '_atoms/icon/icon.html.twig' with { name: 'calendar', size: 'xs', color: 'current' } only %} Créé {{ prompt.createdAt|date('d/m/y') }} {% endif %}