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

Error: {formattedErrorMessage}

}

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

{children} } actions={ additionalActions ? ( <> {additionalActions} ) : ( ) } className={className} /> ) } export default AlertError