mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Get localized error messages.
This commit is contained in:
parent
baba06c692
commit
fc01ee9f56
32 changed files with 90 additions and 85 deletions
|
|
@ -21,10 +21,10 @@ export function ConfirmationForm({
|
|||
onConfirm,
|
||||
onClose,
|
||||
}: ConfirmationFormProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { formatMessage, labels, getErrorMessage } = useMessages();
|
||||
|
||||
return (
|
||||
<Form onSubmit={onConfirm} error={error}>
|
||||
<Form onSubmit={onConfirm} error={getErrorMessage(error)}>
|
||||
<Row marginY="4">{message}</Row>
|
||||
<FormButtons>
|
||||
<Button onPress={onClose}>{formatMessage(labels.cancel)}</Button>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { Empty } from '@/components/common/Empty';
|
|||
|
||||
export interface LoadingPanelProps extends ColumnProps {
|
||||
data?: any;
|
||||
error?: Error;
|
||||
error?: unknown;
|
||||
isEmpty?: boolean;
|
||||
isLoading?: boolean;
|
||||
isFetching?: boolean;
|
||||
|
|
|
|||
|
|
@ -25,14 +25,13 @@ export function TypeConfirmationForm({
|
|||
onConfirm?: () => void;
|
||||
onClose?: () => void;
|
||||
}) {
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
|
||||
const { formatMessage, labels, messages, getErrorMessage } = useMessages();
|
||||
if (!confirmationValue) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Form onSubmit={onConfirm} error={error}>
|
||||
<Form onSubmit={onConfirm} error={getErrorMessage(error)}>
|
||||
<p>
|
||||
{formatMessage(messages.actionConfirmation, {
|
||||
confirmation: confirmationValue,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue