diff --git a/frontend/src/component/common/Dialogue/Dialogue.tsx b/frontend/src/component/common/Dialogue/Dialogue.tsx index a2f41468e5..5d58e137a4 100644 --- a/frontend/src/component/common/Dialogue/Dialogue.tsx +++ b/frontend/src/component/common/Dialogue/Dialogue.tsx @@ -55,6 +55,7 @@ interface IDialogue { disabledPrimaryButton?: boolean; formId?: string; permissionButton?: React.JSX.Element; + customButton?: React.JSX.Element; } export const Dialogue: React.FC = ({ @@ -71,6 +72,7 @@ export const Dialogue: React.FC = ({ fullWidth = false, formId, permissionButton, + customButton, }) => { const handleClick = formId ? (e: React.SyntheticEvent) => { @@ -136,6 +138,11 @@ export const Dialogue: React.FC = ({ } /> + + diff --git a/frontend/src/component/layout/Error/Error.tsx b/frontend/src/component/layout/Error/Error.tsx index 47b03ec83c..a26338789b 100644 --- a/frontend/src/component/layout/Error/Error.tsx +++ b/frontend/src/component/layout/Error/Error.tsx @@ -1,18 +1,28 @@ -import { useEffect, VFC } from 'react'; +import React, { useEffect, VFC } from 'react'; import { useNavigate } from 'react-router-dom'; -import { Box } from '@mui/material'; +import { Box, Button } from '@mui/material'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; +import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig'; interface IErrorProps { error: Error; } +const ZendeskButton = () => { + const openZendeskSupport = () => { + window?.open('https://getunleash.zendesk.com', '_blank'); + }; + return ; +}; + // biome-ignore lint/suspicious/noShadowRestrictedNames: export const Error: VFC = ({ error }) => { const navigate = useNavigate(); const { trackEvent } = usePlausibleTracker(); + const { isOss } = useUiConfig(); + const showZendeskButton = !isOss(); useEffect(() => { const { message, stack = 'unknown' } = error; @@ -41,6 +51,12 @@ export const Error: VFC = ({ error }) => { window?.location?.reload(); }} maxWidth='xl' + customButton={ + } + /> + } > {error.message}