12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import React from 'react';
- import { MARKUP_TYPE } from '../constants';
- import { AnnotationType } from '../constants/type';
- import Head from './AnnotationListHead';
- import Drawer from '../components/Drawer';
- import Body from '../components/AnnotationList';
- import useStore from '../store';
- import {
- Container,
- } from '../global/sidebarStyled';
- const MARKUP_TYPE_ARRAY = Object.values(MARKUP_TYPE);
- const AnnotationList: React.FC = () => {
- const [{
- navbarState,
- annotations,
- viewport,
- scale,
- pdf,
- }] = useStore();
- const isActive = navbarState === 'annotations';
- return (
- <Drawer anchor="right" open={isActive}>
- <Container>
- <Head />
- <Body
- annotations={annotations.filter(
- (ele: AnnotationType) => MARKUP_TYPE_ARRAY.includes(ele.obj_type),
- )}
- viewport={viewport}
- scale={scale}
- pdf={pdf}
- isActive={isActive}
- />
- </Container>
- </Drawer>
- );
- };
- export default AnnotationList;
|