@props([ 'iconVariant' => 'micro', 'iconTrailing' => null, 'initials' => null, 'chevron' => true, 'avatar' => null, 'name' => null, ]) @php // If no initials are provided, we'll try to generate them from the name by taking the first letter of the first and last name... $initials ??= collect(explode(' ', $name ?? '')) ->map(fn($part) => Str::substr($part, 0, 1)) ->filter() ->only([0, count(explode(' ', $name ?? '')) - 1]) ->implode(''); // When using the outline icon variant, we need to size it down to match the default icon sizes... $iconClasses = Flux::classes('text-zinc-400 dark:text-white/80 group-hover:text-zinc-800 dark:group-hover:text-white') ->add($iconVariant === 'outline' ? 'size-4' : ''); $classes = Flux::classes() ->add('group flex items-center rounded-lg') ->add('[ui-dropdown>&]:w-full') // Without this, the "name" won't get truncated in a sidebar dropdown... ->add('p-1 hover:bg-zinc-800/5 dark:hover:bg-white/10') ; @endphp