{% macro ditem(lngstr, available, used, assigned = null, formatbytes = false, byte_usage  = null) %}
	<div class="col border-end border-bottom p-3">
		<div class="row mb-1">
			<div class="col text-truncate">{{ lng(lngstr) }}{% if byte_usage %} <small>({{ byte_usage|formatBytes }}
					)</small>{% endif %}</div>
			<div class="col-auto">
				<small>{% if formatbytes %}{{ used|formatBytes }}{% else %}{{ used }}{% endif %}
					/{% if available < 0 %}{{ lng('panel.unlimited') }}{% else %}{% if formatbytes %}{{ available|formatBytes }}{% else %}{{ available }}{% endif %}{% endif %}</small>
			</div>
		</div>
		{% set usageperc = 1 %}
		{% if available > 0 %}
			{% set usageperc = (used  / available) * 100|round %}
		{% endif %}
		<div class="progress progress-thin my-auto"
			 role="progressbar"
			 aria-valuenow="{% if available < 0 %}100{% else %}{{ used }}{% endif %}"
			 aria-valuemin="0"
			 aria-valuemax="{% if available < 0 %}100{% else %}{{ available }}{% endif %}"
		>
			<div
				class="progress-bar{% if available < 0 %} bg-secondary{% elseif usageperc >= 75 and usageperc < 90 %} bg-warning{% elseif usageperc >= 90 %} bg-danger{% endif %}"
				style="width: {% if available < 0 %}100{% else %}{{ usageperc }}{% endif %}%;"
			></div>
		</div>
		{% if assigned is not empty %}
			<div class="progress progress-thin mt-2 my-auto"
				 role="progressbar"
				 aria-valuenow="{{ assigned }}"
				 aria-valuemin="0"
				 aria-valuemax="{{ available }}"
			>
				<div class="progress-bar bg-primary"
					 style="width:{% if available > 0 %}{{ (assigned / available) * 100|round }}{% else %}1{% endif %}%;"></div>
			</div>
		{% endif %}
	</div>
{% endmacro %}
