2025-12-02 17:24:29 +08:00
|
|
|
import { useFetchUserInfo } from '@/hooks/use-user-setting-request';
|
2025-08-08 11:00:55 +08:00
|
|
|
import { PropsWithChildren } from 'react';
|
|
|
|
|
|
|
|
|
|
export function SharedBadge({ children }: PropsWithChildren) {
|
|
|
|
|
const { data: userInfo } = useFetchUserInfo();
|
|
|
|
|
|
|
|
|
|
if (typeof children === 'string' && userInfo.nickname === children) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-27 02:31:08 +01:00
|
|
|
return (
|
|
|
|
|
<span
|
|
|
|
|
title={typeof children === 'string' ? children : undefined}
|
|
|
|
|
className="inline-block max-w-[120px] truncate align-middle bg-bg-card rounded-sm px-1 text-xs"
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</span>
|
|
|
|
|
);
|
2025-08-08 11:00:55 +08:00
|
|
|
}
|