Reworked settings screens.

This commit is contained in:
Mike Cao
2025-05-03 00:31:37 -07:00
parent c1d301ffdc
commit 0a16ab38e4
58 changed files with 362 additions and 365 deletions

View File

@@ -1,17 +1,22 @@
'use client';
import { useLoginQuery } from '@/components/hooks';
import { useLoginQuery, useMessages } from '@/components/hooks';
import { WebsitesDataTable } from './WebsitesDataTable';
import { WebsitesHeader } from './WebsitesHeader';
import { ROLES } from '@/lib/constants';
import { WebsiteAddButton } from '@/app/(main)/settings/websites/WebsiteAddButton';
import { SectionHeader } from '@/components/common/SectionHeader';
import { Column } from '@umami/react-zen';
export function WebsitesSettingsPage({ teamId }: { teamId: string }) {
const { user } = useLoginQuery();
const canCreate = user.role !== ROLES.viewOnly;
const { formatMessage, labels } = useMessages();
return (
<>
<WebsitesHeader allowCreate={canCreate} />
<Column gap>
<SectionHeader title={formatMessage(labels.websites)}>
{canCreate && <WebsiteAddButton teamId={teamId} />}
</SectionHeader>
<WebsitesDataTable teamId={teamId} />
</>
</Column>
);
}