Get localized error messages.
This commit is contained in:
1 parent
baba06c692
commit
fc01ee9f56
32 files changed
+90
-85
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user