export function resizeComposerInput(input, viewportHeight = globalThis.innerHeight) {
  if (!input) return;
  const minHeight = 40;
  const maxHeight = viewportHeight * 0.6;
  input.style.height = `${minHeight}px`;
  input.style.height = `${Math.min(Math.max(input.scrollHeight, minHeight), maxHeight)}px`;
  input.style.overflowY = input.scrollHeight > maxHeight ? "auto" : "hidden";
}
