2024-02-23 11:34:36 +00:00
|
|
|
<tr @class([
|
2024-03-25 18:07:59 +00:00
|
|
|
'dark:text-white text-black dark:bg-coolblack dark:hover:bg-coolgray-100',
|
|
|
|
'dark:bg-coolgray-100 bg-neutral-200' => $member->id == auth()->user()->id,
|
2024-02-23 11:34:36 +00:00
|
|
|
])>
|
|
|
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
|
|
|
{{ $member->name }}
|
|
|
|
</td>
|
|
|
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
|
|
|
{{ $member->email }}
|
|
|
|
</td>
|
|
|
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
|
|
|
{{ data_get($member, 'pivot.role') }}
|
|
|
|
</td>
|
2024-03-20 11:54:06 +00:00
|
|
|
<td class="flex gap-2 px-5 py-4 text-sm whitespace-nowrap">
|
2023-07-13 20:03:27 +00:00
|
|
|
@if (auth()->user()->isAdminFromSession())
|
2023-06-09 13:55:21 +00:00
|
|
|
@if ($member->id !== auth()->user()->id)
|
2024-02-23 11:34:36 +00:00
|
|
|
@if (auth()->user()->isOwner())
|
|
|
|
@if (data_get($member, 'pivot.role') === 'owner')
|
|
|
|
<x-forms.button wire:click="makeAdmin">To Admin</x-forms.button>
|
|
|
|
<x-forms.button wire:click="makeReadonly">To Member</x-forms.button>
|
|
|
|
<x-forms.button isError wire:click="remove">Remove</x-forms.button>
|
|
|
|
@endif
|
|
|
|
@if (data_get($member, 'pivot.role') === 'admin')
|
|
|
|
<x-forms.button wire:click="makeOwner">To Owner</x-forms.button>
|
|
|
|
<x-forms.button wire:click="makeReadonly">To Member</x-forms.button>
|
|
|
|
<x-forms.button isError wire:click="remove">Remove</x-forms.button>
|
|
|
|
@endif
|
|
|
|
@if (data_get($member, 'pivot.role') === 'member')
|
|
|
|
<x-forms.button wire:click="makeOwner">To Owner</x-forms.button>
|
|
|
|
<x-forms.button wire:click="makeAdmin">To Admin</x-forms.button>
|
|
|
|
<x-forms.button isError wire:click="remove">Remove</x-forms.button>
|
|
|
|
@endif
|
|
|
|
@elseif (auth()->user()->isAdmin())
|
|
|
|
@if (data_get($member, 'pivot.role') === 'admin')
|
|
|
|
<x-forms.button wire:click="makeReadonly">To Member</x-forms.button>
|
|
|
|
<x-forms.button isError wire:click="remove">Remove</x-forms.button>
|
|
|
|
@endif
|
|
|
|
@if (data_get($member, 'pivot.role') === 'member')
|
|
|
|
<x-forms.button wire:click="makeAdmin">To Admin</x-forms.button>
|
|
|
|
<x-forms.button isError wire:click="remove">Remove</x-forms.button>
|
2023-06-09 13:55:21 +00:00
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
@else
|
2024-03-21 11:44:32 +00:00
|
|
|
<div>(This is you)</div>
|
2023-06-09 13:55:21 +00:00
|
|
|
@endif
|
2023-06-02 10:34:45 +00:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|