Skip to content

Commit

Permalink
fix: fixed error component typescript issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hasan-deriv committed Aug 15, 2024
1 parent fdcb476 commit 35bb34b
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions packages/cfd/src/Components/Errors/error-component.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Dialog, PageErrorContainer } from '@deriv/components';
import { routes } from '@deriv/shared';
import { localize } from '@deriv/translations';

type TErrorComponentProps = {
header?: string;
is_dialog?: boolean;
message?: React.ReactNode;
redirect_label?: string;
redirectOnClick?: () => void;
should_show_refresh?: boolean;
};

const ErrorComponent = ({
header,
message,
is_dialog,
redirect_label,
redirectOnClick,
should_show_refresh = true,
}) => {
}: TErrorComponentProps) => {
const refresh_message = should_show_refresh ? localize('Please refresh this page to continue.') : '';

if (is_dialog) {
Expand All @@ -37,14 +45,4 @@ const ErrorComponent = ({
);
};

ErrorComponent.propTypes = {
header: PropTypes.string,
is_dialog: PropTypes.bool,
message: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.object]),
redirect_label: PropTypes.string,
redirectOnClick: PropTypes.func,
should_show_refresh: PropTypes.bool,
type: PropTypes.string,
};

export default ErrorComponent;

0 comments on commit 35bb34b

Please sign in to comment.