2023-05-29 06:37:34 +02:00
|
|
|
import { createContext } from 'react';
|
2023-05-18 08:20:06 +02:00
|
|
|
import Page from 'components/layout/Page';
|
2023-05-20 18:02:08 +02:00
|
|
|
import styles from './reports.module.css';
|
2023-05-29 06:37:34 +02:00
|
|
|
import { useReport } from 'hooks';
|
|
|
|
|
|
|
|
export const ReportContext = createContext(null);
|
|
|
|
|
|
|
|
export function Report({ reportId, defaultParameters, children, ...props }) {
|
|
|
|
const report = useReport(reportId, defaultParameters);
|
2023-05-18 08:20:06 +02:00
|
|
|
|
2023-05-20 18:02:08 +02:00
|
|
|
return (
|
2023-05-29 06:37:34 +02:00
|
|
|
<ReportContext.Provider value={{ ...report }}>
|
|
|
|
<Page {...props} className={styles.container}>
|
|
|
|
{children}
|
|
|
|
</Page>
|
|
|
|
</ReportContext.Provider>
|
2023-05-20 18:02:08 +02:00
|
|
|
);
|
2023-05-18 08:20:06 +02:00
|
|
|
}
|
2023-05-20 18:02:08 +02:00
|
|
|
|
|
|
|
export default Report;
|