Files
torsearch/templates/components/ActionButton.html.twig

14 lines
740 B
Twig

<button
class="h-6 bg-{{ color|default('orange') }}-500/80 hover:bg-{{ color|default('orange') }}-600/80 px-2 text-{{ text_color|default('white') }} rounded-ms text-sm font-semibold"
{% if custom_controller|default and custom_action|default %}
{{ attributes.defaults(stimulus_controller(custom_controller, custom_controller_vars|default({}))) }}
{{ stimulus_action(custom_controller, custom_action|default('default'), custom_action_event|default('click'), custom_action_params|default({})) }}
{% else %}
{{ attributes.defaults(stimulus_controller('action_button')) }}
{{ stimulus_action('action_button', action|default('default')) }}
{% endif %}
>
{{ text|default('button') }}
</button>