@forelse($taskGroups as $taskGroup)
@component('components.tile')
@foreach($taskGroup->tasks as $task)
@php
$total = $compliance['total']->firstWhere('task_id', $task->id)->total ?? 0;
$out = $compliance['overdue']->firstWhere('task_id', $task->id)->total ?? 0;
$in = $total - $out;
if ($total > 0) {
$percent = round(100 - ($out/$total*100), 0, PHP_ROUND_HALF_UP);
} else {
$percent = '-';
}
@endphp
@endforeach
@endcomponent
@empty
@endforelse