{% import "macros/buttons.html" as buttons %}
{% import "macros/icons.html" as icons %}
{% import "macros/datatable.html" as datatable %}

{% macro name_column(user_field) %}
<a
  class="font-medium text-slate-800 hover:text-slate-900"
  href="{{ url_for('dashboard.user_fields:get', id=user_field.id) }}"
  hx-boost="true"
  hx-target="#aside"
  _="install OpenAside"
>
  {{ user_field.name }}
</a>
{% endmacro %}

{% macro slug_column(user_field) %}
{{ user_field.slug }}
{% endmacro %}

{% macro type_column(user_field) %}
{{ user_field.get_type_display_name() }}
{% endmacro %}

{{
  datatable.datatable(
    user_fields,
    count,
    datatable_query_parameters,
    "User fields",
    columns | map("get_column_macro") | list,
  )
}}
