import {useNavigate, useSearchParams} from "react-router-dom";
import {useEffect} from "react";

import useAuth from "@/hooks/useAuth.ts";
import styles from './style.module.scss'
import FormLogin from "./components/form-login.tsx";

export default function UserIndex(){
	const {user} = useAuth();
	const navigate = useNavigate() ;
	const [param] = useSearchParams()
	useEffect(() => {
		if (user) {
			navigate(param.get('from') || '/')
		}
	}, [user])
	return (<div className={styles.main}>
		<div className={"flex-1 ml-[15%]"}>
			{/*<h2 className="text-4xl mb-10 text-white/90">数字人直播间</h2>*/}
			{/*<img className="w-[450px]" src={MainBgImage} alt=""/>*/}
		</div>
		<div className={styles.boxLogin}>
			<FormLogin />
		</div>
	</div>)
}