import { Navigate, useLocation } from 'react-router'; import type { MultiLang } from '../config'; import PageNotFound from './lib/PageNotFound'; interface Props { lang: MultiLang; } const getRedirectUrl = (pathname: string): string => { switch (pathname || '') { case '/index.php': return '/'; } return ''; }; const XoopsPathRedirect = (props: Props) => { const { lang } = props; const location = useLocation(); if (location.pathname === '/') { return null; } const url = getRedirectUrl(location.pathname); if (url === '') { return ; } return ; }; export default XoopsPathRedirect;