import React from "react"; import { Link, useNavigate } from "react-router-dom"; import { ExitIcon, UserIcon, LoginIcon } from "../images/Images"; import { UserProfile } from "@customTypes/Profile"; import { API } from "@api/Api"; interface LoginProps { setToken: React.Dispatch>; profile?: UserProfile; setProfile: React.Dispatch>; isOpen: boolean; } const Login: React.FC = ({ setToken, profile, setProfile, isOpen }) => { const navigate = useNavigate(); const _login = () => { window.location.href = "/api/v1/login"; }; const _logout = () => { setProfile(undefined); setToken(undefined); API.delete_token(); navigate("/"); }; return ( <> {profile ? ( <> {profile.profile ? ( <> ) : ( <> )} ) : ( )} ); }; export default Login;