AnnotationListHead.tsx 507 B

12345678910111213141516171819202122232425
  1. import React from 'react';
  2. import Head from '../components/AnnotationListHead';
  3. import useStore from '../store';
  4. import useActions from '../actions';
  5. const AnnotationListHead: React.FC = () => {
  6. const [{
  7. annotations,
  8. }, dispatch] = useStore();
  9. const {
  10. setNavbar,
  11. addAnnots,
  12. } = useActions(dispatch);
  13. return (
  14. <Head
  15. close={(): void => { setNavbar(''); }}
  16. addAnnots={addAnnots}
  17. hasAnnots={!!annotations.length}
  18. />
  19. );
  20. };
  21. export default AnnotationListHead;