import { render } from '@testing-library/react';
import React, {useState} from 'react';
import {BrowserRouter as Router, Switch, Route, Link} from 'react-router-dom';

const LoginFrom = () => {
   const [login, setLogin] = useState('')
   const [password, setPassword] = useState('Lagin')

   console.log(password)
    return (
        <div className="LoginFrom">
            <input value={login} onChange={e => setLogin(e.target.value)} placeholder="Login"/>
            <input value={password} onChange={e => setPassword(e.target.value)} placeholder="Password" type="password"/>
            <button disabled={!login || !password} >Login {login && `as ${login}`}</button>
        </div>
    )
}

// const Acc = ({param: {a, b}}) => {
const Acc = (props) => {
    return(
        <>
            <div>{console.log(props)}</div>
        </>
    )
}

function App() {
    return (
        <>
            <LoginFrom />           
            <Router>
                <Switch>
                        {/* <Route exact path="/" component={Home} /> */}
                        <Route exact path="/acc/:_id" component={Acc} />
                        {/* <Route exact path="/top" component={Top} /> */}
                </Switch>
            </Router>
        </>
    );
}

export default App;