@php use KFramework\Components\Visual\Button; use KFramework\Components\Visual\ButtonsGroup; @endphp
{!! Button::make() ->setPreIcon(request()->cookie('theme') === 'dark' ? 'weather-sunny' : 'weather-night') ->setClasses(['kfw-theme-button']) ->setOnClick('kfwChangeTheme()') ->setHint(__('kfw::ui.change_theme')) ->setHidden(!!config('k-framework.ui.light_mode')) !!} @if(isset($user)) @php $userImage = ''; if(isset($userProfile) && $userProfile->profile_image) { $userImage = ''; } @endphp {!! Button::make() ->setClasses(['kfw-notification-button']) ->setPreIcon(!empty($unreadNotificationsCount) ? 'bell-badge-outline' : 'bell-outline') ->setSuffix(!empty($unreadNotificationsCount) ? $unreadNotificationsCount : null) ->setHidden(!config('k-framework.modules.user_profile') || !config('k-framework.modules.user_notifications')) ->setOnClick('kfwToggleNotificationPanel()') ->setStyle(!empty($unreadNotificationsCount) ? 'color: var(--warning-color) !important;' : null) . ButtonsGroup::make($userImage) ->setSchema([ '
' . ($userImage) . '
' . ($user->name ?? '') .'
' . ($user->email ?? '') .'
', Button::make(__('kfw::users.profile')) ->setType('primary') ->setPreIcon('account-outline') ->setURL(Route::has('kfw.users.profile') ? route('kfw.users.profile') : null) ->setHidden(!config('k-framework.modules.user_profile')), Button::make(__('kfw::users.logout')) ->setType('danger') ->setPreIcon('logout') ->setURL(route('kfw.users.logout')) ]) !!} @endif