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'; import "@css/Login.css"; import { Button, Buttons } from "@customTypes/Sidebar"; import btn from "@css/Button.module.css"; interface LoginProps { isSearching: boolean; currentBtn: number; buttonsList: Buttons; setCurrentBtn: React.Dispatch>; setToken: React.Dispatch>; profile?: UserProfile; setProfile: React.Dispatch>; }; const Login: React.FC = ({ isSearching, currentBtn, buttonsList, setCurrentBtn, setToken, profile, setProfile }) => { 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;