diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5db0535d..baa6fa61 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -328,7 +328,44 @@ importers: specifier: ^5.9.3 version: 5.9.3 - dist: {} + dist: + dependencies: + chart.js: + specifier: ^4.5.0 + version: 4.5.1 + chartjs-adapter-date-fns: + specifier: ^3.0.0 + version: 3.0.0(chart.js@4.5.1)(date-fns@2.30.0) + colord: + specifier: ^2.9.2 + version: 2.9.3 + jsonwebtoken: + specifier: ^9.0.2 + version: 9.0.2 + lucide-react: + specifier: ^0.542.0 + version: 0.542.0(react@19.2.0) + pure-rand: + specifier: ^7.0.1 + version: 7.0.1 + react-simple-maps: + specifier: ^2.3.0 + version: 2.3.0(prop-types@15.8.1)(react-dom@19.2.0(react@19.2.0))(react@19.2.0) + react-use-measure: + specifier: ^2.0.4 + version: 2.1.7(react-dom@19.2.0(react@19.2.0))(react@19.2.0) + react-window: + specifier: ^1.8.6 + version: 1.8.11(react-dom@19.2.0(react@19.2.0))(react@19.2.0) + serialize-error: + specifier: ^12.0.0 + version: 12.0.0 + thenby: + specifier: ^1.3.4 + version: 1.3.4 + uuid: + specifier: ^11.1.0 + version: 11.1.0 packages: @@ -5152,6 +5189,11 @@ packages: peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 + lucide-react@0.542.0: + resolution: {integrity: sha512-w3hD8/SQB7+lzU2r4VdFyzzOzKnUjTZIF/MQJGSSvni7Llewni4vuViRppfRAa2guOsY5k4jZyxw/i9DQHv+dw==} + peerDependencies: + react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 + lucide-react@0.543.0: resolution: {integrity: sha512-fpVfuOQO0V3HBaOA1stIiP/A2fPCXHIleRZL16Mx3HmjTYwNSbimhnFBygs2CAfU1geexMX5ItUcWBGUaqw5CA==} peerDependencies: @@ -12921,6 +12963,10 @@ snapshots: dependencies: react: 19.2.0 + lucide-react@0.542.0(react@19.2.0): + dependencies: + react: 19.2.0 + lucide-react@0.543.0(react@19.2.0): dependencies: react: 19.2.0 diff --git a/src/app/(main)/admin/AdminLayout.tsx b/src/app/(main)/admin/AdminLayout.tsx index 56561a8e..3c8fa20a 100644 --- a/src/app/(main)/admin/AdminLayout.tsx +++ b/src/app/(main)/admin/AdminLayout.tsx @@ -21,6 +21,7 @@ export function AdminLayout({ children }: { children: ReactNode }) { border="right" backgroundColor marginRight="2" + padding="3" > diff --git a/src/app/(main)/admin/users/[userId]/UserEditForm.tsx b/src/app/(main)/admin/users/[userId]/UserEditForm.tsx index 30c86862..28bf030f 100644 --- a/src/app/(main)/admin/users/[userId]/UserEditForm.tsx +++ b/src/app/(main)/admin/users/[userId]/UserEditForm.tsx @@ -50,7 +50,7 @@ export function UserEditForm({ userId, onSave }: { userId: string; onSave?: () = label={formatMessage(labels.role)} rules={{ required: formatMessage(labels.required) }} > - {formatMessage(labels.viewOnly)} diff --git a/src/app/(main)/settings/SettingsLayout.tsx b/src/app/(main)/settings/SettingsLayout.tsx index adfaaa4f..f6588721 100644 --- a/src/app/(main)/settings/SettingsLayout.tsx +++ b/src/app/(main)/settings/SettingsLayout.tsx @@ -14,6 +14,7 @@ export function SettingsLayout({ children }: { children: ReactNode }) { border="right" backgroundColor marginRight="2" + padding="3" > diff --git a/src/app/(main)/settings/layout.tsx b/src/app/(main)/settings/layout.tsx index e8dfb30d..4e773a37 100644 --- a/src/app/(main)/settings/layout.tsx +++ b/src/app/(main)/settings/layout.tsx @@ -3,7 +3,7 @@ import { SettingsLayout } from './SettingsLayout'; export default function ({ children }) { if (process.env.cloudMode) { - //return null; + return null; } return {children}; diff --git a/src/components/common/SideMenu.tsx b/src/components/common/SideMenu.tsx index bdd24952..92ff798a 100644 --- a/src/components/common/SideMenu.tsx +++ b/src/components/common/SideMenu.tsx @@ -51,7 +51,7 @@ export function SideMenu({ }; return ( - + {title && ( {title} diff --git a/src/components/hooks/queries/useUpdateQuery.ts b/src/components/hooks/queries/useUpdateQuery.ts index 9535c436..85a94425 100644 --- a/src/components/hooks/queries/useUpdateQuery.ts +++ b/src/components/hooks/queries/useUpdateQuery.ts @@ -1,10 +1,11 @@ import { useToast } from '@umami/react-zen'; +import type { ApiError } from '@/lib/types'; import { useApi } from '../useApi'; import { useModified } from '../useModified'; export function useUpdateQuery(path: string, params?: Record) { const { post, useMutation } = useApi(); - const query = useMutation({ + const query = useMutation>({ mutationFn: (data: Record) => post(path, { ...data, ...params }), }); const { touch } = useModified(); diff --git a/src/components/hooks/useMessages.ts b/src/components/hooks/useMessages.ts index 19f12d9a..d5bc2423 100644 --- a/src/components/hooks/useMessages.ts +++ b/src/components/hooks/useMessages.ts @@ -1,5 +1,6 @@ import { FormattedMessage, type MessageDescriptor, useIntl } from 'react-intl'; import { labels, messages } from '@/components/messages'; +import type { ApiError } from '@/lib/types'; type FormatMessage = ( descriptor: MessageDescriptor, @@ -12,7 +13,7 @@ interface UseMessages { messages: typeof messages; labels: typeof labels; getMessage: (id: string) => string; - getErrorMessage: (error: unknown) => string | undefined; + getErrorMessage: (error: ApiError) => string | undefined; FormattedMessage: typeof FormattedMessage; } @@ -25,7 +26,7 @@ export function useMessages(): UseMessages { return message ? formatMessage(message) : id; }; - const getErrorMessage = (error: unknown) => { + const getErrorMessage = (error: ApiError) => { if (!error) { return undefined; } diff --git a/src/lib/types.ts b/src/lib/types.ts index e727c87a..9c061979 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -136,3 +136,8 @@ export interface RealtimeData { urls: Record; visitors: any[]; } + +export interface ApiError extends Error { + code?: string; + message: string; +}