optimizations

This commit is contained in:
2026-03-28 19:15:39 +01:00
parent 0b25d9570a
commit cab4fbd83e
509 changed files with 1016804 additions and 1605 deletions

View File

@@ -1,4 +1,5 @@
import React from 'react'
import LevelBadge from '../xp/LevelBadge'
const ROLE_STYLES = {
admin: 'bg-red-500/15 text-red-300',
@@ -18,6 +19,7 @@ export default function AuthorBadge({ user, size = 'md' }) {
const role = (user?.role ?? 'member').toLowerCase()
const cls = ROLE_STYLES[role] ?? ROLE_STYLES.member
const label = ROLE_LABELS[role] ?? 'Member'
const level = Number(user?.level ?? 0)
const rank = user?.rank ?? null
const imgSize = size === 'sm' ? 'h-8 w-8' : 'h-10 w-10'
@@ -37,11 +39,7 @@ export default function AuthorBadge({ user, size = 'md' }) {
<span className={`inline-flex rounded-full px-2 py-0.5 text-[11px] font-medium ${cls}`}>
{label}
</span>
{rank && (
<span className="inline-flex rounded-full bg-emerald-500/12 px-2 py-0.5 text-[11px] font-medium text-emerald-300">
{rank}
</span>
)}
{rank && level > 0 ? <LevelBadge level={level} rank={rank} compact /> : null}
</div>
</div>
</div>