@props([ 'statusCounts' => [], 'statusColumns' => [], 'totalCount' => 0, 'expandOnHover' => true, 'size' => 'md' ]) @php // Create segments for ALL status columns (even with 0 count) // This ensures JavaScript can update any segment when tickets move $segments = []; foreach ($statusColumns as $statusId => $label) { $count = $statusCounts[$statusId] ?? 0; $percentage = ($totalCount > 0 && $count > 0) ? ($count / $totalCount) * 100 : 0; $segments[] = [ 'id' => $statusId, 'count' => $count, 'percentage' => round($percentage, 1), 'label' => is_array($label) ? ($label['name'] ?? $label['label'] ?? "Status {$statusId}") : $label, ]; } $heights = [ 'collapsed' => ['sm' => '4px', 'md' => '5px', 'lg' => '6px'], 'expanded' => ['sm' => '18px', 'md' => '22px', 'lg' => '26px'] ]; $collapsedHeight = $heights['collapsed'][$size] ?? '5px'; $expandedHeight = $heights['expanded'][$size] ?? '22px'; @endphp