import React, { useState } from 'react'; import styled from 'styled-components/macro'; import { Switch, Route } from 'react-router-dom'; import { PageRoutes } from '../../conf/Global'; import { GlossaryEntityContext } from '../entity/shared/GlossaryEntityContext'; import { GenericEntityProperties } from '../entity/shared/types'; import BusinessGlossaryPage from './BusinessGlossaryPage'; import GlossaryEntitiesPath from './GlossaryEntitiesPath'; import { EntityPage } from '../entity/EntityPage'; import GlossarySidebar from './GlossarySidebar'; import { useEntityRegistry } from '../useEntityRegistry'; const ContentWrapper = styled.div` display: flex; flex: 1; overflow: hidden; `; export default function GlossaryRoutes() { const entityRegistry = useEntityRegistry(); const [entityData, setEntityData] = useState(null); const [urnsToUpdate, setUrnsToUpdate] = useState([]); const isAtRootGlossary = window.location.pathname === PageRoutes.GLOSSARY; return ( {!isAtRootGlossary && } {entityRegistry.getGlossaryEntities().map((entity) => ( } /> ))} } /> ); }