chat-fallback-error.tsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { useTranslation } from 'react-i18next'
  2. import OLNotification from '@/shared/components/ol/ol-notification'
  3. import OLButton from '@/shared/components/ol/ol-button'
  4. import RailPanelHeader from '@/features/ide-react/components/rail/rail-panel-header'
  5. interface ChatFallbackErrorProps {
  6. reconnect?: () => void
  7. }
  8. function ChatFallbackError({ reconnect }: ChatFallbackErrorProps) {
  9. const { t } = useTranslation()
  10. return (
  11. <div className="chat-panel">
  12. <RailPanelHeader title={t('collaborator_chat')} />
  13. <div className="chat-wrapper">
  14. <aside className="chat" aria-label={t('chat')}>
  15. <div className="chat-error">
  16. <OLNotification type="error" content={t('chat_error')} />
  17. {reconnect && (
  18. <p className="text-center">
  19. <OLButton variant="secondary" onClick={reconnect}>
  20. {t('reconnect')}
  21. </OLButton>
  22. </p>
  23. )}
  24. </div>
  25. </aside>
  26. </div>
  27. </div>
  28. )
  29. }
  30. export default ChatFallbackError