AnnotationListHead.tsx 503 B

12345678910111213141516171819202122
  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 [{ annotations }, dispatch] = useStore();
  7. const { setNavbar, addAnnots } = useActions(dispatch);
  8. return (
  9. <Head
  10. close={(): void => {
  11. setNavbar('');
  12. }}
  13. addAnnots={addAnnots}
  14. hasAnnots={!!annotations.length}
  15. />
  16. );
  17. };
  18. export default AnnotationListHead;