Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

selected-tenant.blade.php 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. @props([
  2. 'icon' => null,
  3. 'image' => null,
  4. 'label' => null,
  5. 'iconColor' => null,
  6. 'url' => null,
  7. ])
  8. @php
  9. $buttonClasses = \Illuminate\Support\Arr::toCssClasses([
  10. 'text-gray-700 dark:text-gray-200 text-sm font-medium flex items-center p-2 rounded-lg hover:bg-gray-50 focus-visible:bg-gray-50 dark:hover:bg-white/5 dark:focus-visible:bg-white/5',
  11. 'justify-between' => $icon && $label,
  12. ]);
  13. $iconClasses = \Illuminate\Support\Arr::toCssClasses([
  14. 'h-6 w-6',
  15. match ($iconColor) {
  16. 'gray' => 'text-gray-600 dark:text-gray-500',
  17. default => 'text-custom-500 dark:text-custom-400',
  18. },
  19. ]);
  20. $iconStyles = \Illuminate\Support\Arr::toCssStyles([
  21. \Filament\Support\get_color_css_variables(
  22. $iconColor,
  23. shades: [400, 500],
  24. ) => $iconColor !== 'gray',
  25. ]);
  26. $imageClasses = \Illuminate\Support\Arr::toCssClasses([
  27. 'h-9 w-9 rounded-full bg-cover bg-center mr-4',
  28. ]);
  29. @endphp
  30. <li>
  31. <a
  32. href="{{ $url }}"
  33. {{
  34. $attributes
  35. ->only(['class'])
  36. ->class([$buttonClasses])
  37. }}
  38. >
  39. @if($image)
  40. <div class="{{ $imageClasses }}" style="background-image: url('{{ $image }}')"></div>
  41. @endif
  42. @if($label)
  43. <span class="flex-1">{{ $label }}</span>
  44. @endif
  45. @if($icon)
  46. <x-filament::icon
  47. :icon="$icon"
  48. :class="$iconClasses"
  49. :style="$iconStyles"
  50. />
  51. @endif
  52. </a>
  53. </li>