@nextjs-cms-plugins/google-analytics 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"AnalyticsPage.d.ts","sourceRoot":"","sources":["../../src/client/AnalyticsPage.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,mBAAmB,+CA2B/B,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"AnalyticsPage.d.ts","sourceRoot":"","sources":["../../src/client/AnalyticsPage.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,mBAAmB,+CA4B/B,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -1,14 +1,15 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import getString from 'nextjs-cms/translations';
4
3
  import { trpc as trpcClient } from 'nextjs-cms/api/trpc/client';
4
+ import { useI18n } from 'nextjs-cms/translations/client';
5
5
  export const GoogleAnalyticsPage = () => {
6
+ const t = useI18n();
6
7
  const trpc = trpcClient;
7
8
  const query = trpc?.googleAnalytics?.test.useQuery;
8
9
  const { data, isLoading, isError, error } = query ? query() : { isLoading: true, isError: true, error: null };
9
10
  if (!query) {
10
11
  return (_jsx("div", { className: 'p-6 text-sm text-red-500', children: "Google Analytics plugin misconfigured: missing trpc client." }));
11
12
  }
12
- return (_jsxs("div", { className: 'w-full', children: [_jsx("div", { className: 'text-foreground bg-linear-to-r from-sky-200 via-emerald-300 to-blue-600 p-8 font-extrabold dark:from-blue-800 dark:via-amber-700 dark:to-rose-900', children: _jsx("h1", { className: 'text-3xl', children: getString('analytics') }) }), _jsxs("div", { className: 'p-4', children: [isLoading && _jsx("div", { className: 'text-muted-foreground', children: "Loading analytics\u2026" }), isError && !isLoading && (_jsx("div", { className: 'border-destructive/50 bg-destructive/10 text-destructive rounded border p-3 text-sm', children: error instanceof Error ? error.message : 'Unable to load analytics data' })), data ? _jsx("div", { className: 'text-muted-foreground text-sm', children: "Google Analytics connection OK." }) : null] })] }));
13
+ return (_jsxs("div", { className: 'w-full', children: [_jsx("div", { className: 'text-foreground bg-linear-to-r from-sky-200 via-emerald-300 to-blue-600 p-8 font-extrabold dark:from-blue-800 dark:via-amber-700 dark:to-rose-900', children: _jsx("h1", { className: 'text-3xl', children: t('analytics') }) }), _jsxs("div", { className: 'p-4', children: [isLoading && _jsx("div", { className: 'text-muted-foreground', children: "Loading analytics\u2026" }), isError && !isLoading && (_jsx("div", { className: 'border-destructive/50 bg-destructive/10 text-destructive rounded border p-3 text-sm', children: error instanceof Error ? error.message : 'Unable to load analytics data' })), data ? _jsx("div", { className: 'text-muted-foreground text-sm', children: "Google Analytics connection OK." }) : null] })] }));
13
14
  };
14
15
  export default GoogleAnalyticsPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextjs-cms-plugins/google-analytics",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "peerDependencies": {
26
26
  "react": "19.0.0",
27
27
  "react-dom": "19.0.0",
28
- "nextjs-cms": "0.5.92"
28
+ "nextjs-cms": "0.5.93"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/react": "~19.0.0",