<?php
    /** @var \App\Models\Order|\Closure|null $record */
    if (isset($getRecord) && is_callable($getRecord)) {
        $record = $getRecord();
    }

    if ($record instanceof \Closure) {
        $record = $record();
    }
?>

<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(! $record): ?>
    <div class="text-xs text-gray-600">-</div>
<?php else: ?>
<?php
    $percent = (float) $record->progressPercent();
    $color = (string) $record->progressFilamentColor();
    $hint = (string) $record->progressHintText();

    $barClass = match ($color) {
        'success' => 'bg-success-600',
        'primary' => 'bg-primary-600',
        'warning' => 'bg-warning-600',
        'danger' => 'bg-danger-600',
        default => 'bg-gray-400',
    };
?>

<div class="space-y-1">
    <div class="flex items-center justify-between text-xs text-gray-600">
        <span>Progreso</span>
        <span class="font-medium"><?php echo e(number_format($percent, 1)); ?>%</span>
    </div>

    <div class="h-2 w-full overflow-hidden rounded-full bg-gray-200">
        <div class="h-2 rounded-full <?php echo e($barClass); ?>" style="width: <?php echo e(max(0, min(100, $percent))); ?>%"></div>
    </div>

    <div class="text-xs text-gray-600"><?php echo e($hint); ?></div>
</div>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
<?php /**PATH /home/orderflowpro/public_html/resources/views/filament/orders/partials/order-progress.blade.php ENDPATH**/ ?>