1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-22 22:54:22 +00:00
festa/components/TelegramAvatar.tsx

21 lines
No EOL
473 B
TypeScript

import { LoginContext } from "../contexts/login";
import { useDefinedContext } from "../utils/definedContext";
import { UserData } from "../utils/telegram";
export interface TelegramAvatarProps {
u: UserData
}
export function TelegramAvatar({u}: TelegramAvatarProps) {
const [login, _] = useDefinedContext(LoginContext)
return login ?
<img
src={u.photo_url}
className="avatar-telegram-inline"
/>
:
null
}