import React, { useState } from 'react' import { Link } from 'react-router-dom' import { useDispatch, useSelector } from 'react-redux' import { auth, setUserInfo } from '../../redux/outstaffingSlice' import { loading } from '../../redux/loaderSlice' import ellipse from '../../images/ellipse.png' import { Loader } from '../Loader/Loader' import { fetchAuth } from '../../server/server' import { setRole } from '../../redux/roleSlice' import { selectIsLoading } from '../../redux/loaderSlice' import './authBox.scss' import { withSwalInstance } from 'sweetalert2-react' import swal from 'sweetalert2' const SweetAlert = withSwalInstance(swal) export const AuthBox = ({ title, roleChangeLink }) => { const dispatch = useDispatch() const isLoading = useSelector(selectIsLoading) const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState(null) return (

Войти в систему

{title}
setUsername(e.target.value)} /> setPassword(e.target.value)} /> {error && (
setError(null)} />
)}
) }