umami/components/pages/reports/Report.js

23 lines
587 B
JavaScript
Raw Normal View History

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';
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-07-02 07:02:49 +02:00
//console.log({ report });
2023-05-20 18:02:08 +02:00
return (
<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;