import React from 'react'; import { Redirect, Route } from 'react-router-dom'; import { PageContent } from '../Layout'; import { useAdminMenu } from './adminMenu'; import { useLinks } from '../../hooks'; export const Admin = () => { const { baseURL, adminPageUrl } = useLinks(); const adminMenuList = useAdminMenu(); return (
{ const key = props.match.params.key; const matches = adminMenuList.filter((item) => { return item.key === key; }); return ( 0 ? matches[0] : null} redirectPath={adminPageUrl} /> ); }} /> ( )} /> ( )} />
); };