'use client' import { Chip, cn, Loader } from '@sim/emcn' import { useRouter } from 'next/navigation' import { AuthSubmitButton } from '@/app/(auth)/components' import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants' interface InviteStatusCardProps { type: 'login' | 'loading' | 'error' | 'success' | 'invitation' | 'warning' title: string description: string | React.ReactNode icon?: 'userPlus' | 'mail' | 'users' | 'error' | 'success' | 'warning' actions?: Array<{ label: string onClick: () => void disabled?: boolean loading?: boolean }> isExpiredError?: boolean } const EMPTY_ACTIONS: NonNullable = [] export function InviteStatusCard({ type, title, description, icon: _icon, actions = EMPTY_ACTIONS, isExpiredError = false, }: InviteStatusCardProps) { const router = useRouter() if (type === 'loading') { return ( <>

Loading

{description}

) } return ( <>

{title}

{description}

{isExpiredError && ( router.push('/')} loadingLabel=''> Request New Invitation )} {actions.map((action, index) => index === 0 ? ( {action.label} ) : ( {action.loading ? ( {action.label}... ) : ( action.label )} ) )}
) }