Added ability to delete reports.

This commit is contained in:
Mike Cao 2023-07-30 00:11:26 -07:00
parent ad710cc86a
commit 95d824542f
8 changed files with 159 additions and 40 deletions

View file

@ -7,7 +7,11 @@ import WebsiteHeader from './WebsiteHeader';
export function WebsiteReportsPage({ websiteId }) {
const { formatMessage, labels } = useMessages();
const { reports, error, isLoading } = useReports(websiteId);
const { reports, error, isLoading, deleteReport } = useReports(websiteId);
const handleDelete = async id => {
await deleteReport(id);
};
return (
<Page loading={isLoading} error={error}>
@ -22,7 +26,7 @@ export function WebsiteReportsPage({ websiteId }) {
</Button>
</Link>
</Flexbox>
<ReportsTable websiteId={websiteId} data={reports} />
<ReportsTable data={reports} onDelete={handleDelete} />
</Page>
);
}