import MessageType from '@/utils/MessageType'
import MessageText from '@/components/messages/MessageText.vue'
import MessageImage from '@/components/messages/MessageImage.vue'
import MessageFile from '@/components/messages/MessageFile.vue'
import MessageVoice from '@/components/messages/MessageVoice.vue'
import MessageVideo from '@/components/messages/MessageVideo.vue'
import MessageMultipleForward from "@/components/messages/MessageMultipleForward.vue";
import VimPlugin from "@/plugins/VimPlugin";

const useMessageComponent = (type: string) => {
  switch (type) {
    case MessageType.image:
      return MessageImage
    case MessageType.file:
      return MessageFile
    case MessageType.voice:
      return MessageVoice
    case MessageType.video:
      return MessageVideo
    case MessageType.forward:
      return MessageMultipleForward
    case MessageType.text:
      return MessageText
    default:
      return VimPlugin.renderMessage(type)
  }
}

export default useMessageComponent
