import { useRef, useEffect } from 'react'; import { BiTrash } from 'react-icons/bi/index'; import { LuCopy, LuDownload } from 'react-icons/lu/index'; import { FaCheck } from 'react-icons/fa6/index'; import { FaUndo } from 'react-icons/fa/index'; import { Modal } from '@/components/modal'; import { Button } from './button'; import { useNoteStore } from '@/store'; import { useCopy } from '@/hooks/use-copy'; import { download } from '@/helpers/download'; import styles from './notepad.module.css'; interface NotepadProps { onClose: () => void; show: boolean; } export function Notepad({ onClose, show }: NotepadProps) { const textareaRef = useRef(null); const note = useNoteStore(state => state.note); const history = useNoteStore(state => state.history); const write = useNoteStore(state => state.write); const words = useNoteStore(state => state.words()); const characters = useNoteStore(state => state.characters()); const clear = useNoteStore(state => state.clear); const restore = useNoteStore(state => state.restore); const { copy, copying } = useCopy(); useEffect(() => { if (show && textareaRef.current) { setTimeout(() => { textareaRef.current?.focus(); }, 10); } }, [show]); return (

Your Note