Skip to content
Snippets Groups Projects

Draft: Resolve "Runtime Integration with module federation"

3 files
+ 62
0
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 44
0
import {
INVESTIGATION_ENDPOINT,
Loading,
useGetEndpoint,
usePath,
} from '@edata-portal/core';
import { Suspense } from 'react';
import { Alert } from 'react-bootstrap';
export function Investigation() {
const investigationId = usePath('investigationId');
return (
<>
<Suspense fallback={<Loading />}>
<InvestigationInfo investigationId={investigationId} />
</Suspense>
</>
);
}
export function InvestigationInfo({
investigationId,
}: {
investigationId: string;
}) {
const investigation = useGetEndpoint({
endpoint: INVESTIGATION_ENDPOINT,
params: {
investigationId,
},
});
if (!investigation) {
return <Alert>Could not find investigation</Alert>;
}
return (
<Alert variant="info">
<strong>
Investigation {investigation.title} - {investigation.summary}
</strong>
</Alert>
);
}
Loading