import './App.css';
import React, { useState, useEffect, ReactDOM } from 'react';
import { Spoiler } from './copmonents/Spoiler';
import { RangeInput } from './copmonents/RengeInput';
import { LoginForm } from './copmonents/LoginForm';
import { PasswordConfirm } from './copmonents/PasswordConfirm';
import { Timer } from './copmonents/FormatTime';
import { TimerControl } from './copmonents/TimerControl';
import { TimerControl2 } from './copmonents/TimerControl2';
import { TimerContainer } from './copmonents/TimerContainer';
import { LCD } from './copmonents/LCD';
import { Watch } from './copmonents/Watch/Watch';

const App = () => {
  return (
    <div>
      <h3>Task 1: Spoiler </h3>
      <div>
        <Spoiler header={<h1>Заголовок</h1>}>
          Контент 1<p>лорем ипсум траливали и тп.</p>
        </Spoiler>

        <Spoiler>
          <h2>Контент 2</h2>
          <p>лорем ипсум траливали и тп.</p>
        </Spoiler>
      </div>
      <hr />
      <h3>Task 2: RangeInput </h3>
      <RangeInput min={2} max={10} />;
      <hr />
      <h3>Task 3: LoginForm </h3>
      <LoginForm onLogin={console.log} />
      <hr />
      <h3>Task 4: PasswordConfirm </h3>
      <PasswordConfirm min={3} />
      <hr />
      <h3>Task 5: Timer </h3>
      <Timer seconds={3600} />
      <hr />
      <h3>Task 6: TimerControl </h3>
      <TimerControl render={Timer} />
      <hr />
      <h3>Task 7: TimerContainer </h3>
      <TimerContainer seconds={1800} refresh={1000} render={SecondsTimer} />
      <hr />
      <h3>Task 8: LCD </h3>
      <TimerContainer seconds={1800} refresh={1000} render={LCD} />
      <hr />
      <h3>Task 9: Watch </h3>
      <Watch seconds={40} minutes={15} hours={4} />
      <hr />
      <h3>Task 10: TimerControl + TimerContainer </h3>
      <TimerControl2 />
      <hr />
    </div>
  );
};
const SecondsTimer = ({ seconds }) => <h2>{seconds}</h2>;

export default App;
