refactored react-examples app and created generic test case component

This commit is contained in:
Peter
2023-11-07 16:19:09 +01:00
parent b8a75ccac6
commit 8be0337e00
7 changed files with 299 additions and 70 deletions
@@ -0,0 +1,17 @@
import { useLocation } from 'react-router-dom';
import Flow from './Flow';
export default () => {
const location = useLocation();
const files = import.meta.glob<GenericTestCase>('./**/*.ts', { eager: true, import: 'default' });
const testCasePath = `.${location.pathname.replace('/tests/generic', '')}.ts`;
const testCase = files[testCasePath];
if (!testCase) {
return <div></div>;
}
return <Flow generics={testCase} />;
};