1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 07:04:22 +00:00
festa/components/TelegramUserInline.tsx
2022-05-29 04:01:56 +02:00

28 lines
No EOL
622 B
TypeScript

import { TelegramLoginData } from "../types/user";
import { TelegramAvatar } from "./TelegramAvatar";
interface Props {
u: TelegramLoginData
}
export function TelegramUserInline({u}: Props) {
if(u.username) return (
<a href={`https://t.me/${u.username}`}>
<TelegramAvatar u={u}/>
{u.username}
</a>
)
else if(u.last_name) return (
<span>
<TelegramAvatar u={u}/>
{u.first_name} {u.last_name}
</span>
)
else return (
<span>
<TelegramAvatar u={u}/>
{u.first_name}
</span>
)
}