mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
feat(identity): show binding in profile panel
This commit is contained in:
@@ -2,6 +2,7 @@ import type { LucideIcon } from "lucide-react";
|
||||
import {
|
||||
Activity,
|
||||
ArrowUpRight,
|
||||
BadgeCheck,
|
||||
Copy,
|
||||
Cpu,
|
||||
Ear,
|
||||
@@ -22,6 +23,7 @@ import type {
|
||||
Profile,
|
||||
RelayAgent,
|
||||
} from "@/shared/api/types";
|
||||
import { VerifiedBadge } from "@/shared/ui/VerifiedBadge";
|
||||
|
||||
const RUNTIME_LABELS: Record<string, string> = {
|
||||
goose: "Goose",
|
||||
@@ -47,6 +49,7 @@ export type ProfileField = {
|
||||
|
||||
const AGENT_INFO_LABELS = new Set([
|
||||
"Public key",
|
||||
"Corporate identity",
|
||||
"Managed by",
|
||||
"NIP-05",
|
||||
"Agent type",
|
||||
@@ -174,6 +177,22 @@ export function buildPublicFields({
|
||||
});
|
||||
}
|
||||
|
||||
const verifiedName = profile?.verifiedName?.trim();
|
||||
if (verifiedName) {
|
||||
fields.push({
|
||||
displayValue: verifiedName,
|
||||
icon: BadgeCheck,
|
||||
label: "Corporate identity",
|
||||
testId: "user-profile-corporate-identity",
|
||||
trailingNode: (
|
||||
<span className="flex shrink-0 items-center gap-1.5 text-xs font-medium text-muted-foreground">
|
||||
<VerifiedBadge verifiedName={verifiedName} />
|
||||
Binding active
|
||||
</span>
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
if (profile?.nip05Handle) {
|
||||
fields.push({
|
||||
copyValue: profile.nip05Handle,
|
||||
@@ -407,16 +426,19 @@ export function buildOwnerFields({
|
||||
function orderProfileFields(fields: ProfileField[]) {
|
||||
const visibilityLabel = "Visibility";
|
||||
const publicKeyLabel = "Public key";
|
||||
const corporateIdentityLabel = "Corporate identity";
|
||||
const managedByLabel = "Managed by";
|
||||
const statusLabel = "Status";
|
||||
return [
|
||||
...fields.filter((field) => field.label === visibilityLabel),
|
||||
...fields.filter((field) => field.label === publicKeyLabel),
|
||||
...fields.filter((field) => field.label === corporateIdentityLabel),
|
||||
...fields.filter((field) => field.label === managedByLabel),
|
||||
...fields.filter(
|
||||
(field) =>
|
||||
field.label !== visibilityLabel &&
|
||||
field.label !== publicKeyLabel &&
|
||||
field.label !== corporateIdentityLabel &&
|
||||
field.label !== managedByLabel &&
|
||||
field.copyValue,
|
||||
),
|
||||
@@ -425,6 +447,7 @@ function orderProfileFields(fields: ProfileField[]) {
|
||||
if (
|
||||
field.label === visibilityLabel ||
|
||||
field.label === publicKeyLabel ||
|
||||
field.label === corporateIdentityLabel ||
|
||||
field.label === managedByLabel ||
|
||||
field.label === statusLabel
|
||||
) {
|
||||
|
||||
@@ -57,6 +57,7 @@ import { cn } from "@/shared/lib/cn";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/shared/ui/alert";
|
||||
import { Badge } from "@/shared/ui/badge";
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/shared/ui/tooltip";
|
||||
import { VerifiedBadge } from "@/shared/ui/VerifiedBadge";
|
||||
|
||||
export { AgentInstructionsFocusedView } from "@/features/profile/ui/UserProfilePanelAgentDetails";
|
||||
|
||||
@@ -529,6 +530,16 @@ function ProfileHero({
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{profile?.verifiedName?.trim() ? (
|
||||
<div
|
||||
className="flex items-center justify-center gap-1.5 text-sm font-medium text-muted-foreground"
|
||||
data-testid="user-profile-verified-alias"
|
||||
>
|
||||
<span>{profile.verifiedName.trim()}</span>
|
||||
<VerifiedBadge verifiedName={profile.verifiedName.trim()} />
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{profile?.about?.trim() ? (
|
||||
<ProfileHeroDescription
|
||||
about={profile.about.trim()}
|
||||
|
||||
Reference in New Issue
Block a user