Refactor icon rendering logic and update edit indicator styling
This commit is contained in:
@@ -30,26 +30,20 @@
|
||||
$hasCustomIcon = optional($service->product->server)->extension === 'Proxmox' && isset($proxmoxServer) && $proxmoxServer && $proxmoxServer->user_set_icon;
|
||||
$iconColor = $hasCustomIcon ? $proxmoxServer->user_set_icon_color : null;
|
||||
@endphp
|
||||
<div class="relative flex items-center mr-6">
|
||||
@if($hasCustomIcon)
|
||||
@php
|
||||
$iconPrefix = $proxmoxServer->user_set_icon_prefix ?? 'ri';
|
||||
$iconName = $proxmoxServer->user_set_icon;
|
||||
if ($iconPrefix === 'vaadin') {
|
||||
$componentName = 'vaadin-' . str_replace('_', '-', $iconName);
|
||||
} else {
|
||||
$componentName = $iconPrefix . '-' . $iconName;
|
||||
}
|
||||
@endphp
|
||||
<x-dynamic-component :component="$componentName" class="w-14 h-14" :style="$iconColor ? 'color: ' . $iconColor : ''" />
|
||||
@else
|
||||
<x-ri-box-3-fill class="w-14 h-14 text-primary" />
|
||||
@endif
|
||||
<!-- Small edit indicator in upper-right of the icon -->
|
||||
<div class="absolute -top-1 -right-1 flex items-center justify-center w-5 h-5 rounded-full bg-white shadow-md border border-primary/30">
|
||||
<x-ri-pencil-line class="w-3.5 h-3.5 text-primary" />
|
||||
</div>
|
||||
</div>
|
||||
@if($hasCustomIcon)
|
||||
@php
|
||||
$iconPrefix = $proxmoxServer->user_set_icon_prefix ?? 'ri';
|
||||
$iconName = $proxmoxServer->user_set_icon;
|
||||
if ($iconPrefix === 'vaadin') {
|
||||
$componentName = 'vaadin-' . str_replace('_', '-', $iconName);
|
||||
} else {
|
||||
$componentName = $iconPrefix . '-' . $iconName;
|
||||
}
|
||||
@endphp
|
||||
<x-dynamic-component :component="$componentName" class="size-10 mr-4" :style="$iconColor ? 'color: ' . $iconColor : ''" />
|
||||
@else
|
||||
<x-ri-box-3-fill class="size-10 mr-4 text-primary" />
|
||||
@endif
|
||||
{{ __('services.services') }}
|
||||
|
||||
</h1>
|
||||
|
||||
Reference in New Issue
Block a user