104 lines
4.9 KiB
PHP
104 lines
4.9 KiB
PHP
<flux:main>
|
|
<div class="flex justify-between items-center">
|
|
<div>
|
|
<flux:heading size="xl">{{ $pageTitle }}</flux:heading>
|
|
</div>
|
|
@can('create tier')
|
|
<div>
|
|
<flux:modal.trigger name="form-modal">
|
|
<flux:button variant="primary" class="text-sm"
|
|
wire:click="$dispatch('modal:open', {method: 'create', 'modalTitle': 'Tambah Tier'})">Tambah
|
|
</flux:button>
|
|
</flux:modal.trigger>
|
|
</div>
|
|
@endcan
|
|
</div>
|
|
|
|
<div class="mt-6">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4">
|
|
@foreach ($tiers as $tier)
|
|
<flux:card
|
|
class="hover:shadow-lg transition-shadow duration-200 bg-white dark:bg-gray-900 text-gray-900 dark:text-white">
|
|
<div class="space-y-4">
|
|
<div class="flex items-start justify-between">
|
|
<flux:heading size="lg">{{ $tier['name'] }}
|
|
</flux:heading>
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<div class="flex justify-between text-sm">
|
|
<span class="text-gray-500 dark:text-gray-400">Min. Poin:</span>
|
|
<span class="font-medium">{{ $tier['min_points'] }}</span>
|
|
</div>
|
|
<div class="flex justify-between text-sm">
|
|
<span class="text-gray-500 dark:text-gray-400">Maks. Poin:</span>
|
|
<span class="font-medium">{{ $tier['max_points'] }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex gap-2 pt-2 border-t border-gray-200 dark:border-gray-700">
|
|
@can('update tier')
|
|
<flux:modal.trigger name="form-modal">
|
|
<flux:tooltip content="Ubah">
|
|
<flux:button variant="primary" color="yellow" icon="pencil-square" size="sm"
|
|
wire:click="$dispatch('modal:open', {method: 'update', 'modalTitle': 'Ubah Tier', 'id': '{{ $tier['hash'] }}'})">
|
|
Ubah
|
|
</flux:button>
|
|
</flux:tooltip>
|
|
</flux:modal.trigger>
|
|
@endcan
|
|
|
|
@can('delete tier')
|
|
<flux:modal.trigger name="delete">
|
|
<flux:tooltip content="Hapus">
|
|
<flux:button variant="danger" icon="trash" size="sm"
|
|
wire:click="$dispatch('fn:confirmDelete', {id: '{{ $tier['hash'] }}'})">
|
|
Hapus
|
|
</flux:button>
|
|
</flux:tooltip>
|
|
</flux:modal.trigger>
|
|
@endcan
|
|
</div>
|
|
</div>
|
|
</flux:card>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
|
|
@include('components.confirmation.delete')
|
|
<flux:modal name="form-modal" class="w-[95%] max-w-sm md:max-w-xl mx-auto" @close="closeModal('form-modal')">
|
|
<div class="p-4 space-y-6">
|
|
<flux:heading size="lg">{{ $modalTitle }}</flux:heading>
|
|
|
|
<flux:field>
|
|
<flux:label>Nama <span class="text-red-500 ms-1">*</span></flux:label>
|
|
<flux:input placeholder="Masukkan nama tier" wire:model.live.debounce.500ms="form.name" autofocus
|
|
autocomplete="off" />
|
|
<flux:error name="form.name" />
|
|
</flux:field>
|
|
|
|
<flux:field>
|
|
<flux:label>Min. Poin <span class="text-red-500 ms-1">*</span></flux:label>
|
|
<flux:input placeholder="Masukkan minimal poin" wire:model.live.debounce.500ms="form.min_points"
|
|
autocomplete="off" x-mask:dynamic="$money($input, ',')" />
|
|
<flux:error name="form.min_points" />
|
|
</flux:field>
|
|
|
|
<flux:field>
|
|
<flux:label>Maks. Poin </flux:label>
|
|
<flux:input placeholder="Masukkan maksimal poin" wire:model.live.debounce.500ms="form.max_points"
|
|
autocomplete="off" x-mask:dynamic="$money($input, ',')" />
|
|
<flux:error name="form.max_points" />
|
|
</flux:field>
|
|
|
|
<div class="flex">
|
|
<flux:spacer />
|
|
<flux:button variant="primary" class="sm:w-auto cursor-pointer" wire:click="{{ $method }}">
|
|
Simpan
|
|
</flux:button>
|
|
</div>
|
|
</div>
|
|
</flux:modal>
|
|
|
|
</flux:main>
|