import { ExclamationCircleIcon, LinkIcon } from '@heroicons/react/24/outline' import { Button } from '@mantine/core' import { ComponentType, ReactNode } from 'react' import PageContentBlock from '@/components/elements/PageContentBlock' export interface IconProps { className?: string } interface BaseProps { title: string icon?: ComponentType message: string full?: boolean center?: boolean children?: ReactNode onRetry?: () => void onBack?: () => void } interface PropsWithRetry extends BaseProps { onRetry?: () => void onBack?: never } interface PropsWithBack extends BaseProps { onBack?: () => void onRetry?: never } export type ScreenBlockProps = PropsWithBack | PropsWithRetry const ScreenBlock = ({ title, icon: Icon, message, center, onBack, onRetry, full, children, }: ScreenBlockProps) => { return (
{Icon && ( )}

{title}

{message}

{children} {(onBack || onRetry) && (
)}
) } type ErrorMessageProps = ( | Omit | Omit ) & { title?: string } export const ErrorMessage = ({ title, ...props }: ErrorMessageProps) => ( ) export const NotFound = ({ title, message, onBack, full, }: Partial>) => ( ) export default ScreenBlock