mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-28 08:47:50 +02:00
21 lines
536 B
JavaScript
21 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;
|