Tighten Users filters and admin-only header badges.

Match sticky headers to sidebar glass, drop the Users role column, and show compact owner/admin badges only where needed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-11 00:23:39 +03:30
co-authored by Cursor
parent 6c52ce1247
commit 722933dda9
11 changed files with 160 additions and 86 deletions
+14 -8
View File
@@ -4,6 +4,7 @@ import { Menu, Bell, MessageSquare, ChevronDown, User, Settings, KeyRound, LogOu
import { LanguageSelect, PasswordResetModal, useLocale } from '@meshkee/dashboard-ui'
import { useAuth } from '../context/AuthContext'
import { useT } from '../i18n/useT'
import { getActiveBusinessId } from '../lib/businessContext'
import { changePassword } from '../services/authService'
import styles from './Header.module.css'
@@ -40,13 +41,16 @@ export function Header() {
const menuRef = useRef<HTMLDivElement>(null)
const displayName = displayUserName(user, locale, t('app.userFallback'))
const roleLabel =
user?.roleLabel ??
(user?.isSuperAdmin || user?.roles.includes('super_admin')
? t('role.superAdmin')
: user?.businesses[0]?.isOwner
? t('role.owner')
: user?.businesses[0]?.teamRole ?? t('role.staff'))
const isSuperAdmin = Boolean(user?.isSuperAdmin || user?.roles.includes('super_admin'))
const activeBusinessId = getActiveBusinessId()
const membership =
user?.businesses.find((b) => String(b.id) === String(activeBusinessId)) ??
user?.businesses[0]
const adminBadgeLabel = isSuperAdmin
? t('role.superAdmin')
: membership?.teamRole === 'admin'
? t('role.admin')
: null
useEffect(() => {
if (!menuOpen) return
@@ -112,7 +116,9 @@ export function Header() {
>
<div className={styles.profileInfo}>
<span className={styles.name}>{displayName}</span>
<span className={styles.role}>{roleLabel}</span>
{adminBadgeLabel ? (
<span className={styles.roleBadge}>{adminBadgeLabel}</span>
) : null}
</div>
<ChevronDown
size={16}