{{#each otherResources as |group|}}
{{> 'resource-row' user=group.user resources=group.resources isOwner=false}}
{{/each}}
{{#if (and otherResources.length ownResources.length)}}
<hr>
{{/if}}
{{#each ownResources as |group|}}
{{> 'resource-row' user=group.user resources=group.resources isOwner=true}}
{{/each}}


{{#*inline 'resource-row'}}
{{#each resources as |resource|}}
<div class="resource" data-user-id="{{../user}}" data-resource-id="{{resource.id}}"
    style="--ratio: {{resource.ratio}};">
    <div class="name">
        {{#if resource.shared}}
        {{#if ../isOwner}}
        <i class="fa-solid fa-eye"></i>
        {{else if (eq ../user 'world')}}
        <i class="fa-sharp fa-solid fa-earth-americas"></i>
        {{else}}
        <i class="fa-solid fa-user"></i>
        {{/if}}
        {{/if}}
        {{resource.label}}
    </div>
    <div class="stats">
        <div class="filler"></div>
        <div class="value">{{resource.value}}</div>
    </div>
    {{#if ../isOwner}}
    <a class="left" data-action="decrease-resource" data-tooltip="{{resource.decrease}}">
        <div class="min dim">{{resource.min}}</div>
        <div class="decrease">
            <i class="fa-solid fa-minus"></i>
        </div>
    </a>
    <a class="right" data-action="increase-resource" data-tooltip="{{resource.increase}}">
        <div class="max dim">{{resource.max}}</div>
        <div class="increase">
            <i class="fa-solid fa-plus"></i>
        </div>
    </a>
    {{else}}
    <div class="left">
        <div class="dim">{{resource.min}}</div>
    </div>
    <div class="right">
        <div class="dim">{{resource.max}}</div>
    </div>
    {{/if}}
</div>
{{/each}}
{{/inline}}
