Enhance server icon display with user-defined colors and fallback option

This commit is contained in:
2025-12-06 12:44:42 -05:00
parent 27243101e7
commit f7f8190718

View File

@@ -4,9 +4,20 @@
<div class="flex items-center justify-between mb-2">
<div class="flex items-center gap-3">
<div class="bg-secondary/10 p-2 rounded-lg">
<x-ri-server-line class="size-5 text-secondary" />
</div>
@if($server->user_set_icon)
@php
$iconColor = $server->user_set_icon_color ?? '#6366f1';
// Calculate a lighter background color (20% opacity of the icon color)
$bgColor = $iconColor . '33'; // 33 in hex = 20% opacity
@endphp
<div class="p-2 rounded-lg" style="background-color: {{ $bgColor }};">
<x-dynamic-component :component="$server->user_set_icon" class="size-5" style="color: {{ $iconColor }};" />
</div>
@else
<div class="bg-secondary/10 p-2 rounded-lg">
<x-ri-server-line class="size-5 text-secondary" />
</div>
@endif
<span class="font-medium">{{ $status->name }}</span>
</div>
<div class="flex items-center gap-2 px-3 py-1.5 rounded-lg