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

28 lines
622 B
TypeScript
Raw Normal View History

2022-05-29 02:01:56 +00:00
import { TelegramLoginData } from "../types/user";
2022-05-27 00:46:30 +00:00
import { TelegramAvatar } from "./TelegramAvatar";
2022-05-25 15:50:31 +00:00
2022-05-29 02:01:56 +00:00
interface Props {
u: TelegramLoginData
2022-05-25 15:50:31 +00:00
}
2022-05-29 02:01:56 +00:00
export function TelegramUserInline({u}: Props) {
2022-05-25 15:50:31 +00:00
if(u.username) return (
<a href={`https://t.me/${u.username}`}>
2022-05-27 00:46:30 +00:00
<TelegramAvatar u={u}/>
2022-05-25 15:50:31 +00:00
{u.username}
</a>
)
else if(u.last_name) return (
<span>
2022-05-27 00:46:30 +00:00
<TelegramAvatar u={u}/>
2022-05-25 15:50:31 +00:00
{u.first_name} {u.last_name}
</span>
)
else return (
<span>
2022-05-27 00:46:30 +00:00
<TelegramAvatar u={u}/>
{u.first_name}
2022-05-25 15:50:31 +00:00
</span>
)
}