mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
- Rewrite messages.ts to plain string key maps (remove MessageDescriptor) - Rewrite useMessages hook to expose t from useTranslations() directly - Rename formatMessage → t across 193 consumer files - Replace custom FormattedMessage component with next-intl t.rich() - Update 52 language files to use rich text tags (<b>, <a>) - Remove all direct imports from @/components/messages in favor of useMessages() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
'use client';
|
|
import { Column } from '@umami/react-zen';
|
|
import { PageBody } from '@/components/common/PageBody';
|
|
import { PageHeader } from '@/components/common/PageHeader';
|
|
import { Panel } from '@/components/common/Panel';
|
|
import { useLoginQuery, useMessages, useNavigation, useTeamMembersQuery } from '@/components/hooks';
|
|
import { ROLES } from '@/lib/constants';
|
|
import { PixelAddButton } from './PixelAddButton';
|
|
import { PixelsDataTable } from './PixelsDataTable';
|
|
|
|
export function PixelsPage() {
|
|
const { user } = useLoginQuery();
|
|
const { t, labels } = useMessages();
|
|
const { teamId } = useNavigation();
|
|
const { data } = useTeamMembersQuery(teamId);
|
|
|
|
const showActions =
|
|
(teamId &&
|
|
data?.data.filter(team => team.userId === user.id && team.role !== ROLES.teamViewOnly)
|
|
.length > 0) ||
|
|
(!teamId && user.role !== ROLES.viewOnly);
|
|
|
|
return (
|
|
<PageBody>
|
|
<Column gap="6" margin="2">
|
|
<PageHeader title={t(labels.pixels)}>
|
|
{showActions && <PixelAddButton teamId={teamId} />}
|
|
</PageHeader>
|
|
<Panel>
|
|
<PixelsDataTable showActions={showActions} />
|
|
</Panel>
|
|
</Column>
|
|
</PageBody>
|
|
);
|
|
}
|