<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;

$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['type' => 'primary', 'href' => null, 'icon' => null, 'buttonType' => 'button', 'loading' => false]));

foreach ($attributes->all() as $__key => $__value) {
    if (in_array($__key, $__propNames)) {
        $$__key = $$__key ?? $__value;
    } else {
        $__newAttributes[$__key] = $__value;
    }
}

$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);

unset($__propNames);
unset($__newAttributes);

foreach (array_filter((['type' => 'primary', 'href' => null, 'icon' => null, 'buttonType' => 'button', 'loading' => false]), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
    $$__key = $$__key ?? $__value;
}

$__defined_vars = get_defined_vars();

foreach ($attributes->all() as $__key => $__value) {
    if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}

unset($__defined_vars, $__key, $__value); ?>

<?php ($class = match($type) {
    'secondary' => 'btn-secondary',
    'danger' => 'btn-danger',
    'success' => 'btn-success',
    default => 'btn-primary',
}); ?>

<?php if($href): ?>
    <a href="<?php echo e($href); ?>" <?php echo e($attributes->merge(['class' => 'admin-button '.$class])); ?>>
        <?php if($icon): ?><i class="bi <?php echo e($icon); ?>"></i><?php endif; ?><?php echo e($slot); ?>

    </a>
<?php else: ?>
    <button type="<?php echo e($buttonType); ?>" <?php echo e($attributes->merge(['class' => 'admin-button '.$class])); ?> <?php if($loading): echo 'disabled'; endif; ?>>
        <?php if($loading): ?>
            <svg class="animate-spin -ml-1 mr-2 h-4 w-4 inline-block" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
                <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
                <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
            </svg>
        <?php elseif($icon): ?>
            <i class="bi <?php echo e($icon); ?>"></i>
        <?php endif; ?>
        <?php echo e($slot); ?>

    </button>
<?php endif; ?>
<?php /**PATH /Users/mac/Documents/e-com/resources/views/components/admin/button.blade.php ENDPATH**/ ?>