{% import 'macros/links.html' as links %}
<tr class="{{ styles.tr }}">
  <td class="p-2 align-top w-2/6">
    <div class="font-medium">
      {% call links.link(
        url_for(
          'calendars.calendar.day.calendar_entries.calendar_entry.get',
          slug=post.slug,
          calendar_slug=calendar.slug,
          day=day,
          month=month,
          year=year,
          entry_id=entry.id
        ),
        hx_select_search,
        aclass=styles.pill
      ) %}
        {{ entry.name }}
      {% endcall %}
    </div>
  </td>
  <td class="p-2 align-top w-1/6">
    {% if entry.slot %}
      <div class="text-xs font-medium">
        {% call links.link(
          url_for(
            'calendars.calendar.slots.slot.get',
            slug=post.slug,
            calendar_slug=calendar.slug,
            slot_id=entry.slot.id
          ),
          hx_select_search,
          aclass=styles.pill
        ) %}
          {{ entry.slot.name }}
        {% endcall %}
        <span class="text-stone-600 font-normal">
          ({{ entry.slot.time_start.strftime('%H:%M') }}{% if entry.slot.time_end %} → {{ entry.slot.time_end.strftime('%H:%M') }}{% endif %})
        </span>
      </div>
    {% else %}
      <div class="text-xs text-stone-600">
        {% include '_types/entry/_times.html' %}
      </div>
    {% endif %}
  </td>
  <td class="p-2 align-top w-1/6">
    <div id="entry-state-{{entry.id}}">
      {% include '_types/entry/_state.html' %}
    </div>
  </td>
  <td class="p-2 align-top w-1/6">
    <span class="font-medium text-green-600">
      £{{ ('%.2f'|format(entry.cost)) if entry.cost is not none else '0.00' }}
    </span>
  </td>
  <td class="p-2 align-top w-1/6">
    {% if entry.ticket_price is not none %}
      <div class="text-xs space-y-1">
        <div class="font-medium text-green-600">£{{ ('%.2f'|format(entry.ticket_price)) }}</div>
        <div class="text-stone-600">
          {% if entry.ticket_count is not none %}
            {{ entry.ticket_count }} tickets
          {% else %}
            Unlimited
          {% endif %}
        </div>
      </div>
    {% else %}
      <span class="text-xs text-stone-400">No tickets</span>
    {% endif %}
  </td>
  <td class="p-2 align-top w-1/6">
    {% include '_types/entry/_options.html' %}
  </td>
</tr>