{% set panel_status = table.status %}
{% set full_log_button_class = table.full_log_button_class %}

{% set table_markup %}
	<div class="row shield-section-datatable">
		<div class="col">
			{% if table.is_empty %}
				<div class="alert alert-{{ table.empty_status }} mb-0">{{ table.empty_text }}</div>
			{% else %}
				<table class="table table-striped table-bordered"
					   style="width: 100%;"
					   data-investigation-table="1"
					   data-table-type="{{ table.table_type }}"
					   data-subject-type="{{ table.subject_type }}"
					   data-subject-id="{{ table.subject_id }}"
					   data-datatables-init="{{ table.datatables_init_attr|e('html_attr') }}"
					   data-table-action="{{ table.table_action_attr|e('html_attr') }}"
				></table>
			{% endif %}
		</div>
	</div>
{% endset %}

{% if table.is_flat %}
	<section class="investigate-table-panel investigate-table-panel--flat mb-3 status-{{ panel_status }}">
		{% if table.show_header %}
			<div class="d-flex justify-content-between align-items-center mb-3">
				<h3 class="card-title h5 mb-0">{{ table.title }}</h3>
				{% if table.full_log_href is not empty %}
					<a href="{{ table.full_log_href }}" class="{{ full_log_button_class }}">{{ table.full_log_text }}</a>
				{% endif %}
			</div>
		{% endif %}
		{{ table_markup }}
	</section>
{% else %}
	<section class="card shield-card mb-3 status-{{ panel_status }}">
		<div class="shield-card-accent status-{{ panel_status }}"></div>
		<div class="card-body">
			{% if table.show_header %}
				<div class="d-flex justify-content-between align-items-center mb-3">
					<h3 class="card-title h5 mb-0">{{ table.title }}</h3>
					{% if table.full_log_href is not empty %}
						<a href="{{ table.full_log_href }}" class="{{ full_log_button_class }}">{{ table.full_log_text }}</a>
					{% endif %}
				</div>
			{% endif %}
			{{ table_markup }}
		</div>
	</section>
{% endif %}
