Files
ragflow/web/src/components/shared-badge.tsx

13 lines
452 B
TypeScript
Raw Normal View History

import { useFetchUserInfo } from '@/hooks/use-user-setting-request';
import { PropsWithChildren } from 'react';
export function SharedBadge({ children }: PropsWithChildren) {
const { data: userInfo } = useFetchUserInfo();
if (typeof children === 'string' && userInfo.nickname === children) {
return null;
}
return <span className="bg-bg-card rounded-sm px-1 text-xs inline-block max-w-[120px] truncate align-middle">{children}</span>;
}