mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
386 B
TypeScript
14 lines
386 B
TypeScript
import React from 'react';
|
|
import { useCachedUserInfo } from 'tailchat-shared';
|
|
|
|
export const UserName: React.FC<{
|
|
userId: string;
|
|
className?: string;
|
|
}> = React.memo((props) => {
|
|
const { userId, className } = props;
|
|
const cachedUserInfo = useCachedUserInfo(userId);
|
|
|
|
return <span className={className}>{cachedUserInfo.nickname}</span>;
|
|
});
|
|
UserName.displayName = 'UserName';
|