import * as React from "react";
import {useSearchParams} from "react-router-dom";
import {Loading} from "../../../../components/core/Loading";
import {useAuth} from "../../../../hooks/useAuth";
import {authClient} from "../../../../lib/clients/AuthClient";

export function TelegramCode() {
    const [searchParams] = useSearchParams();
    const {checkSession} = useAuth();

    authClient.loginByCode(searchParams.get("code"), checkSession)

    return (
        <Loading loading={true}/>
    )
}