2026-05-23 12:53:33 -04:00
|
|
|
import React from 'react';
|
2026-06-28 21:54:42 -04:00
|
|
|
import { color, Icon, Icons, Text, Tooltip, TooltipProvider } from 'folds';
|
2026-05-23 12:53:33 -04:00
|
|
|
import { useUserVerifiedStatus } from '../hooks/useUserVerifiedStatus';
|
|
|
|
|
|
|
|
|
|
type MemberVerificationBadgeProps = {
|
|
|
|
|
userId: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function MemberVerificationBadge({ userId }: MemberVerificationBadgeProps) {
|
|
|
|
|
const vs = useUserVerifiedStatus(userId);
|
|
|
|
|
if (vs === 'unknown') return null;
|
2026-06-28 21:54:42 -04:00
|
|
|
const iconColor = vs === 'verified' ? color.Success.Main : color.Warning.Main;
|
2026-05-23 12:53:33 -04:00
|
|
|
const label = vs === 'verified' ? 'Identity verified' : 'Not verified';
|
|
|
|
|
return (
|
|
|
|
|
<TooltipProvider
|
|
|
|
|
position="Top"
|
|
|
|
|
tooltip={
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<Text size="T200">{label}</Text>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
{(ref) => (
|
|
|
|
|
<span
|
|
|
|
|
ref={ref}
|
|
|
|
|
title={label}
|
|
|
|
|
style={{ display: 'inline-flex', alignItems: 'center', flexShrink: 0 }}
|
|
|
|
|
>
|
2026-06-28 21:54:42 -04:00
|
|
|
<Icon size="100" src={Icons.ShieldUser} style={{ color: iconColor }} />
|
2026-05-23 12:53:33 -04:00
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</TooltipProvider>
|
|
|
|
|
);
|
|
|
|
|
}
|