{% macro author(author) %}
  {% if author %}
    {% if author.profile_image %}
      <img
        src="{{ author.profile_image }}"
        alt="{{ author.name }}"
        class="h-6 w-6 rounded-full object-cover border border-stone-300 flex-shrink-0"
      >
    {% else %}
      <div class="h-6 w-6"></div>
      {# optional fallback circle with first letter
      <div class="h-6 w-6 rounded-full bg-stone-200 text-stone-600 text-[10px] font-semibold flex items-center justify-center border border-stone-300 flex-shrink-0">
        {{ author.name[:1] }}
      </div> #}
    {% endif %}

    <span class="inline-block rounded-full bg-stone-100 text-stone-600 px-2 py-1 text-sm font-medium border border-stone-200">
      {{ author.name }}
    </span>
  {% endif %}
{% endmacro %}