import { useEffect, useState } from 'react';
import './App.css'
import Bouton from "./interface/Bouton";
import CatHistory from "./interface/CatHistory";
import Chats from "./interface/Chats";

function App() {

  const [status, setStatus] = useState({})

  useEffect(() => {
    const fetchData = async () => {
      const res = await fetch(`http://localhost:3000/status`)
      const data = await res.json()
      setStatus(data)
    }
    fetchData()
  }, []);

  return (
    <div className="App">
        <div>
            <h1>La chatière de Pina !</h1>
        </div>
        <Bouton status={status} />
        <Chats status={status} />
        <CatHistory/>
    </div>
  )
}

export default App
