Files
ladill-care/resources/views/components/btn.blade.php
T
isaaccladandCursor 6360035631
Deploy Ladill Care / deploy (push) Successful in 43s
Replace ghost destructive actions with shared btn components in Care.
Members, appointments, bills, prescriptions, and patients now use consistent warning/danger pill buttons.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 06:38:10 +00:00

35 lines
839 B
PHP

@props([
'variant' => 'primary',
'href' => null,
'type' => 'button',
'size' => null,
'plain' => false,
])
@php
$tag = $href ? 'a' : 'button';
$variantClass = match ($variant) {
'secondary' => 'btn-secondary',
'warning' => 'btn-warning',
'danger' => 'btn-danger',
'link' => 'btn-link',
default => 'btn-primary',
};
$classes = collect([
$variantClass,
$size === 'sm' ? 'btn-sm' : null,
($plain && $variant === 'link') ? 'btn-link-plain' : null,
($plain && $variant === 'danger') ? 'btn-danger-plain' : null,
])->filter()->implode(' ');
@endphp
<{{ $tag }}
@if ($href) href="{{ $href }}" @endif
@if ($tag === 'button') type="{{ $type }}" @endif
{{ $attributes->class([$classes]) }}
>
{{ $slot }}
</{{ $tag }}>