dealhub/resources/views/components/ui/button.blade.php
kusowl a248d3fc79 feat(deal update and delete): broker can update and delete their deals
- show external links in listings
- refactor image-input.blade.php to display image while update
- refactor image-input.js to show selected image after user clicks submit
- refactor components to accept default value
- add FileService to handle image update and delete
2026-01-13 15:10:55 +05:30

30 lines
948 B
PHP

@props(['variant' => '', 'icon' => '', 'link' => ''])
@php
$variants = [
'neutral' => 'bg-primary-600 text-white',
'red' => 'bg-red-500 text-white'
];
$variantClass = $variants[$variant] ?? '';
@endphp
@if($link !== '')
<a {{$attributes->merge(['class' => "px-4 py-2 rounded-lg font-medium hover:opacity-80 $variantClass", 'href' => $link])}}>
<div class="flex justify-center items-center space-x-2">
@if($icon !=='')
@svg("heroicon-o-$icon", 'w-5 h-5')
@endif
<p>{{$slot}}</p>
</div>
</a>
@else
<button {{$attributes->merge(['class' => "px-4 py-2 rounded-lg font-medium hover:opacity-80 $variantClass"])}}>
<div class="flex justify-center items-center space-x-2">
@if($icon !=='')
@svg("heroicon-o-$icon", 'w-5 h-5')
@endif
<p>{{$slot}}</p>
</div>
</button>
@endif