1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 15:14:23 +00:00
festa/components/TelegramUserLink.tsx

24 lines
477 B
TypeScript
Raw Normal View History

2022-05-25 15:50:31 +00:00
import { UserData } from "../utils/telegram";
interface TelegramUserLinkProps {
u: UserData
}
export function TelegramUserLink({u}: TelegramUserLinkProps) {
if(u.username) return (
<a href={`https://t.me/${u.username}`}>
{u.username}
</a>
)
else if(u.last_name) return (
<span>
{u.first_name} {u.last_name}
</span>
)
else return (
<span>
u.first_name
</span>
)
}