{% macro artifact_euid_link(artifact_euid) -%}
{% if artifact_euid %}
<a class="mono mono-link" href="/artifacts/euid/{{ artifact_euid }}">{{ artifact_euid }}</a>
{% else %}
<span class="mono">n/a</span>
{% endif %}
{%- endmacro %}

{% macro artifact_storage_action(artifact_euid, storage_uri) -%}
{% if artifact_euid and storage_uri and storage_uri.startswith("s3://") %}
<form class="inline-download-form" method="post" action="/artifacts/euid/{{ artifact_euid }}/download" onsubmit="return confirm('Download {{ artifact_euid }}?');">
  <input type="hidden" name="share_ttl_hours" value="24" />
  <button class="link-button mono" type="submit" title="Generate a presigned download URL and download this artifact.">{{ storage_uri }}</button>
</form>
{% elif storage_uri %}
<span class="mono">{{ storage_uri }}</span>
{% else %}
<span class="mono">n/a</span>
{% endif %}
{%- endmacro %}
