import React, { useState, useRef, useEffect } from 'react' import { BaseBoxShapeUtil, TLBaseShape, TLShapeId, createShapeId, IndexKey, TLParentId, HTMLContainer } from '@tldraw/tldraw' import { ObsidianObsNote } from '@/lib/obsidianImporter' import { QuartzSync, createQuartzNoteFromShape, QuartzSyncConfig } from '@/lib/quartzSync' import { logGitHubSetupStatus } from '@/lib/githubSetupValidator' import { getClientConfig } from '@/lib/clientConfig' import { StandardizedToolWrapper } from '../components/StandardizedToolWrapper' import { usePinnedToView } from '../hooks/usePinnedToView' // Auto-resizing textarea component const AutoResizeTextarea: React.FC<{ value: string onChange: (value: string) => void onBlur: () => void onKeyDown: (e: React.KeyboardEvent) => void style: React.CSSProperties placeholder?: string onPointerDown?: (e: React.PointerEvent) => void }> = ({ value, onChange, onBlur, onKeyDown, style, placeholder, onPointerDown }) => { const textareaRef = useRef(null) const adjustHeight = () => { const textarea = textareaRef.current if (textarea) { textarea.style.height = 'auto' textarea.style.height = `${textarea.scrollHeight}px` } } useEffect(() => { adjustHeight() // Focus the textarea when it mounts if (textareaRef.current) { textareaRef.current.focus() } }, [value]) return (