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

31 lines
893 B
TypeScript
Raw Normal View History

2022-05-25 15:50:31 +00:00
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"
/>
</>
}