{% if (stats.length) { %}
<div class="dropdown-search mb-1">
	<input type="text"
		placeholder="${__("Search")}"
		data-element="search"
		class="dropdown-search-input form-control input-xs"
	>
</div>
{% } %}
{% if (!stats.length) { %}
<li class="stat-no-records text-muted">{{ __("No records tagged.") }}</li>
{% } else {
	for (var i=0, l=stats.length; i < l; i++) {
		var stat_label = stats[i][0];
		var stat_count = stats[i][1];
%}
<li>
	<a class="stat-link dropdown-item flex justify-between group-by-item" data-label="{{ stat_label }}" data-value="{{ stat_label }}" data-field="_user_tags" href="#" onclick="return false;">

		<span class="stat-label">
			{% if (applied_filter == stat_label) { %}
				<span class="applied"> {{ frappe.utils.icon("tick", "xs") }} </span>
			{% } %}
			{{ __(stat_label) }}
		</span>
		<span>{{ stat_count }}</span>
	</a>
</li>
	{% }
} %}
