{% load i18n %}
{# @description The list-view "add" action: a button that opens a create modal, or links straight to the create view. #}
{# @prop label:text | default:"Add" | description:"The button's text." #}
{# @prop icon:text | default:"add" | description:"The button's icon." #}
{# @prop directory:text | description:"The view's URL directory; the action links to its create_url." #}
{# @prop create_form:text | description:"A create form; when given, the action opens it in a modal." #}
{# @prop create_modal_title:text | description:"Heading of the create modal; the label when absent." #}
{# @prop size:select['xs','sm','md','lg','xl'] | description:"The button's size, DaisyUI's default when left out." #}
{# @prop compact:boolean | description:"Below sm, draw the icon alone. The label is still the button's name to a screen reader." #}
{% if directory.create_url and create_form %}
{{ label }}
{% elif directory.create_url %}
{{ label }}
{% endif %}