Refactored queries.

This commit is contained in:
Mike Cao 2024-01-30 00:10:25 -08:00
parent 18e36aa7b3
commit b16f5cc067
67 changed files with 523 additions and 576 deletions

View file

@ -0,0 +1,27 @@
'use client';
import Link from 'next/link';
import { Button, Flexbox, Icon, Icons, Text } from 'react-basics';
import { useMessages } from 'components/hooks';
import ReportsDataTable from 'app/(main)/reports/ReportsDataTable';
export function TeamReports({ websiteId }) {
const { formatMessage, labels } = useMessages();
return (
<>
<Flexbox alignItems="center" justifyContent="end">
<Link href={`/reports/create`}>
<Button variant="primary">
<Icon>
<Icons.Plus />
</Icon>
<Text>{formatMessage(labels.createReport)}</Text>
</Button>
</Link>
</Flexbox>
<ReportsDataTable websiteId={websiteId} />
</>
);
}
export default TeamReports;

View file

@ -0,0 +1,10 @@
import { Metadata } from 'next';
import ReportTemplates from 'app/(main)/reports/create/ReportTemplates';
export default function () {
return <ReportTemplates />;
}
export const metadata: Metadata = {
title: 'Create Report | umami',
};

View file

@ -0,0 +1,15 @@
import { Metadata } from 'next';
import ReportsHeader from 'app/(main)/reports/ReportsHeader';
import ReportsDataTable from 'app/(main)/reports/ReportsDataTable';
export default function ({ params: { teamId } }) {
return (
<>
<ReportsHeader />
<ReportsDataTable teamId={teamId} />
</>
);
}
export const metadata: Metadata = {
title: 'Reports | umami',
};

View file

@ -1,4 +1,4 @@
import WebsiteDetails from '../../../../websites/[websiteId]/WebsiteDetails';
import WebsiteDetails from 'app/(main)/websites/[websiteId]/WebsiteDetails';
export default function TeamWebsitePage({ params: { websiteId } }) {
return <WebsiteDetails websiteId={websiteId} />;