mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 03:55:37 +01:00
Fixed nav menus.
This commit is contained in:
parent
dcc1ae1864
commit
d7fd22645c
9 changed files with 62 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue