// skip import for KO (Knockout.js) here, it should be available in global deps
import Vue from 'vue';
import ProjectsConversationWrapper from 'ProjectsConversationWrapper';
import { getProjectConversation } from 'api';
// unique component identifier
const uniqueId = 'chat-project-room';
const bindingHandlerInit = async (element, valueAccessor) => {
const projectId = parseInt(ko.unwrap(valueAccessor()), 10);
// find conversation based on given project ID
const { conversation } = await getProjectConversation(projectId);
const conversationId = conversation.id;
// our reactive data object observed by Vue
const data = {
conversationId,
};
// Vue setup
const vueConfig = {
el: `#${uniqueId}`,
data,
template: '