overleaf-cep/services/web/frontend/js/features/chat/components/chat-fallback-error.tsx
Alf Eaton 003fa536df Convert Chat components to TypeScript (#22672)
GitOrigin-RevId: b47a7fc3f77055335990ee0215bd32ae65b1ebfe
2025-01-14 09:04:45 +00:00

28 lines
760 B
TypeScript

import { useTranslation } from 'react-i18next'
import OLNotification from '@/features/ui/components/ol/ol-notification'
import OLButton from '@/features/ui/components/ol/ol-button'
interface ChatFallbackErrorProps {
reconnect?: () => void
}
function ChatFallbackError({ reconnect }: ChatFallbackErrorProps) {
const { t } = useTranslation()
return (
<aside className="chat">
<div className="chat-error">
<OLNotification type="error" content={t('chat_error')} />
{reconnect && (
<p className="text-center">
<OLButton variant="secondary" onClick={reconnect}>
{t('reconnect')}
</OLButton>
</p>
)}
</div>
</aside>
)
}
export default ChatFallbackError