Update dynamic icon component to support user-defined prefixes

This commit is contained in:
2025-12-06 12:46:21 -05:00
parent f7f8190718
commit df77a29925

View File

@@ -9,9 +9,13 @@
$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
// Build the full component name with prefix
$iconPrefix = $server->user_set_icon_prefix ?? 'ri';
$iconName = $server->user_set_icon;
$componentName = $iconPrefix . '-' . $iconName;
@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 }};" />
<x-dynamic-component :component="$componentName" class="size-5" style="color: {{ $iconColor }};" />
</div>
@else
<div class="bg-secondary/10 p-2 rounded-lg">