import React, { ReactNode, useState } from 'react';
import logo from './logo.svg';
import './App.css';
import Toast from 'react-bootstrap/Toast';
import Button from 'react-bootstrap/Button';

interface Props {
  children?: ReactNode
}


const ExampleToast = ({ children }: Props) => {
  const [show, toggleShow] = useState(true);

  return (
  <>
    {!show && <Button onClick={() => toggleShow(true)}>Show Toast</Button>}
    <Toast show={show} onClose={() => toggleShow(false)}>
      <Toast.Header>
        <strong className="mr-auto">React-Bootstrap</strong>
      </Toast.Header>
      <Toast.Body>{children}</Toast.Body>
    </Toast>
  </>
  );
};

function App() {
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <p>
          Edit <code>src/App.tsx</code> and save to reload, Eli.
        </p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
	<Button onClick={() => {console.log("hey")}}>Hey</Button>
	<ExampleToast/>
      </header>
    </div>
  );
}

export default App;
