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

31 lines
No EOL
893 B
TypeScript

import { Trans, useTranslation } from "next-i18next"
import { LoginContext } from "../contexts/login"
import { useDefinedContext } from "../hooks/useDefinedContext"
import { LoginButton } from "./LoginButton"
import { TelegramUserLink } from "./TelegramUserLink"
export function Intro() {
const {t} = useTranslation("common")
const [login, setLogin] = useDefinedContext(LoginContext)
const loginMessage = login ? (
<Trans i18nKey="introTelegramLoggedIn">
Sei connesso come <TelegramUserLink u={login}/>!
</Trans>
) : (
<Trans i18nKey="introTelegramLogin">
Effettua il login con Telegram per iniziare a creare il tuo evento.
</Trans>
)
return <>
<p>
{loginMessage}
</p>
<LoginButton
botName="festaappbot"
/>
</>
}