import { useI18n } from 'domains/i18n/hooks'
import { ChannelEvent } from 'domains/store/store.types'
import { useMemo } from 'preact/hooks'
import { CollapsedChatMessages } from './collapsed-chat-messages'

export default function ContinueChatMessages() {
  const { t } = useI18n()
  const continueChatText = t('window.chat.continue')
  const continueChatEvent = useMemo(
    (): ChannelEvent => ({
      type: 'message',
      payload: {
        type: 'custom',
        body: {
          text: continueChatText,
          type: '',
          data: {},
        },
        participant: 'seamly-client-participant',
      },
    }),
    [continueChatText],
  )

  return <CollapsedChatMessages events={[continueChatEvent]} />
}
