import { appendStyle } from '@content/service/util';

const elementChat = {
  parent: 'div.UvGSSkd1qQ',
  main: 'div.Z8RjJZsXy1',
  chat: 'none',
  contentText: 'none',
};

export const resizeChatWindow = async (width = 1200, height = 650) => {
  const scaleChat = `
    ${elementChat.parent} {
      width : ${width}px !important;
      height : ${height}px !important;
    }

    ${elementChat.main} {
      height: ${height - 42}px !important;
    }

    ${elementChat.chat} {
      height: ${height - 143}px !important;
    }

    ${elementChat.contentText} {
      max-width: ${width * 0.45}px !important;
    }

    ${elementChat.contentText} > pre {
      max-width: ${width * 0.45}px !important;
    }
  `;

  appendStyle(scaleChat);
};
