import { useReactiveVar } from '@apollo/client/react';
import { selectedBook } from './apolloClient';

const Info: React.FC = () => {
  const selectedBookVar = useReactiveVar(selectedBook);

  return (
    <div>
      Ausgewähltes Buch:
      {(selectedBookVar && selectedBookVar.title) || 'Kein Buch ausgewählt'}
    </div>
  );
};

export default Info;
