import './App.css';
import { type InputBook } from './Book';
import BookForm from './BookForm';

const App: React.FC = () => {
  return (
    <div>
      <h1>Datensatz anlegen</h1>
      <BookForm
        onSave={(book: InputBook) => {
          console.log(book);
        }}
      />
      <hr />
      <h1>Datensatz bearbeiten</h1>
      <BookForm
        book={{
          id: 1,
          title: 'JavaScript - das umfassende Handbuch',
          author: 'Philip Ackermann',
          isbn: '978-3836286299',
          rating: 5,
        }}
        onSave={(book: InputBook) => {
          console.log(book);
        }}
      />
    </div>
  );
};

export default App;

