Posts

ali

"use client"; import { useState, useEffect, useRef } from "react"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/textarea"; import { motion, AnimatePresence } from "framer-motion"; export default function AliApp() { const [text, setText] = useState(""); const [storedText, setStoredText] = useState (null); const [isEditing, setIsEditing] = useState(false); const [editValue, setEditValue] = useState(""); const [showCopied, setShowCopied] = useState(false); const [buttonState, setButtonState] = useState ("idle"); const longPressTimer = useRef (null); // Load stored text from localStorage on component mount useEffect(() => { const savedText = localStorage.getItem("aliAppText"); if (savedText) { setStoredText(savedText); } }, []); // Save text to localStorage whenever storedText changes useEffect(() => { if (storedText !== null) { localStorage.setItem(...