add skeleton state

This commit is contained in:
Ren Amamiya
2023-05-06 16:09:16 +07:00
parent 77e56b3dd4
commit 417df1796d
12 changed files with 111 additions and 207 deletions

View File

@@ -2,15 +2,7 @@ import { useProfile } from '@lume/utils/hooks/useProfile';
import { shortenKey } from '@lume/utils/shortenKey';
export const NoteMentionUser = ({ pubkey }: { pubkey: string }) => {
const { user, isError, isLoading } = useProfile(pubkey);
const { user } = useProfile(pubkey);
return (
<>
{isError || isLoading ? (
<span className="inline-flex h-4 w-10 animate-pulse rounded bg-zinc-800"></span>
) : (
<span className="cursor-pointer text-fuchsia-500">@{user?.username || user?.name || shortenKey(pubkey)}</span>
)}
</>
);
return <span className="cursor-pointer text-fuchsia-500">@{user?.username || user?.name || shortenKey(pubkey)}</span>;
};