import logo from './logo.svg';
import './App.css';
import React, { useEffect, useState } from 'react';

//LoginForm
const LoginForm = ({ onLogin }) => {

    const [login, setLogin] = useState('')
    const [pass, setPass] = useState('')

    return (
        <div>
            <h2>Loginform</h2>
            <input value={login} onChange={e => setLogin(e.target.value)} />
            <br />
            <input value={pass} onChange={e => setPass(e.target.value)} />
            <br />
            <button disabled={((login == '') || (pass == '')) || false} onClick={() => onLogin(login, pass)}>login</button>
        </div>
    )
}

function App() {
    return (
        <div className="App">
            <header>

                {/* Loginform */}
                <LoginForm onLogin={(l, p) => console.log('LOGIN', l, p)} />

            </header>
        </div>
    );
}

export default App;