import { SupportCategories } from '@supabase/shared-types/out/constants' import { SupportLink } from 'components/interfaces/Support/SupportLink' import { PropsWithChildren } from 'react' import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button, WarningIcon, } from 'ui' export interface AlertErrorProps { projectRef?: string subject?: string error?: { message: string } | null className?: string showIcon?: boolean additionalActions?: React.ReactNode } // [Joshen] To standardize the language for all error UIs export const AlertError = ({ projectRef, subject, error, className, showIcon = true, children, additionalActions, }: PropsWithChildren) => { const formattedErrorMessage = error?.message?.includes('503') ? '503 Service Temporarily Unavailable' : error?.message return ( {showIcon && } {subject}
{error?.message &&

Error: {formattedErrorMessage}

}

Try refreshing your browser, but if the issue persists for more than a few minutes, please reach out to us via support.

{children}
{additionalActions}
) } export default AlertError