{"version":3,"file":"useTextareaRef.mjs","names":[],"sources":["../../../../../src/components/MessageComposer/hooks/useTextareaRef.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport type { MessageComposerProps } from '../MessageComposer';\n\nexport const useTextareaRef = (props: MessageComposerProps) => {\n  const { focus } = props;\n  const textareaRef = useRef<HTMLTextAreaElement>(undefined);\n  useEffect(() => {\n    if (focus && textareaRef.current) {\n      textareaRef.current.focus();\n    }\n  }, [focus]);\n\n  return {\n    textareaRef,\n  };\n};\n"],"mappings":";;AAGA,IAAa,kBAAkB,UAAgC;CAC7D,MAAM,EAAE,UAAU;CAClB,MAAM,cAAc,OAA4B,KAAA,CAAS;CACzD,gBAAgB;EACd,IAAI,SAAS,YAAY,SACvB,YAAY,QAAQ,MAAM;CAE9B,GAAG,CAAC,KAAK,CAAC;CAEV,OAAO,EACL,YACF;AACF"}