import { Space } from "antd";
import React from "react";
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
import ChatArchiveButton from "../chat-archive-button/chat-archive-button.component";
import ChatConversationTitleTags from "../chat-conversation-title-tags/chat-conversation-title-tags.component";
import ChatLabelComponent from "../chat-label/chat-label.component";
import ChatTagRoContainer from "../chat-tag-ro/chat-tag-ro.container";

export default function ChatConversationTitle({ conversation }) {
  return (
    <Space wrap>
      <PhoneNumberFormatter>
        {conversation && conversation.phone_num}
      </PhoneNumberFormatter>
      <ChatLabelComponent conversation={conversation} />
      <ChatConversationTitleTags
        jobConversations={
          (conversation && conversation.job_conversations) || []
        }
      />
      <ChatTagRoContainer conversation={conversation || []} />
      <ChatArchiveButton conversation={conversation} />
    </Space>
  );
}
