mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
20 lines
536 B
JavaScript
20 lines
536 B
JavaScript
'use client';
|
|
import { createContext } from 'react';
|
|
import { useReport } from 'components/hooks';
|
|
import styles from './Report.module.css';
|
|
|
|
export const ReportContext = createContext(null);
|
|
|
|
export function Report({ reportId, defaultParameters, children, ...props }) {
|
|
const report = useReport(reportId, defaultParameters);
|
|
|
|
return (
|
|
<ReportContext.Provider value={{ ...report }}>
|
|
<div {...props} className={styles.container}>
|
|
{children}
|
|
</div>
|
|
</ReportContext.Provider>
|
|
);
|
|
}
|
|
|
|
export default Report;
|