@abydahana/aksara-ui 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,9 +15,13 @@ export function UserItem(props) {
|
|
|
15
15
|
const verifiedBadge = verified
|
|
16
16
|
? `<i class="mdi mdi-check-decagram text-primary ms-1" style="font-size: 1rem; vertical-align: middle;" title="Verified"></i>`
|
|
17
17
|
: "";
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
? `<div class="user-item-
|
|
18
|
+
const cleanHandle = handle ? handle.replace(/^@/, "").trim() : "";
|
|
19
|
+
const handleHtml = cleanHandle
|
|
20
|
+
? `<div class="user-item-handle text-subtle text-xs text-truncate">@${escapeHtml(cleanHandle)}</div>`
|
|
21
|
+
: "";
|
|
22
|
+
const hasDistinctSubtitle = Boolean(subtitle && (!cleanHandle || subtitle.replace(/^@/, "").trim() !== cleanHandle));
|
|
23
|
+
const subtitleHtml = hasDistinctSubtitle
|
|
24
|
+
? `<div class="user-item-subtitle text-subtle ${cleanHandle ? "text-xs" : "text-sm"} text-truncate mt-0.5">${escapeHtml(subtitle)}</div>`
|
|
21
25
|
: "";
|
|
22
26
|
const contentCol = `
|
|
23
27
|
<div class="user-item-info flex-1 min-w-0">
|
|
@@ -25,6 +29,7 @@ export function UserItem(props) {
|
|
|
25
29
|
<span class="user-item-name font-bold text-sm text-truncate text-body">${escapeHtml(name)}</span>
|
|
26
30
|
${verifiedBadge}
|
|
27
31
|
</div>
|
|
32
|
+
${handleHtml}
|
|
28
33
|
${subtitleHtml}
|
|
29
34
|
</div>
|
|
30
35
|
`.trim();
|