import React, { useRef, useState } from "react"; import { motion } from "framer-motion"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { Type, X, Sparkles, Shuffle } from "lucide-react"; export default function EnhancedTextInput({ text: _text, inputText, onChange: _onChange, onTextChange, placeholder, onRandomFont, }) { const text = _text ?? inputText ?? ""; const change = _onChange ?? onTextChange ?? (() => {}); const safeLen = (v) => (typeof v === "string" ? v.length : 0); const inputRef = useRef(null); const [focused, setFocused] = useState(false); const quickTexts = [ "Hello Instagram! 👋", "Follow me! ✨", "New Post 🔥", "Story Time 📖", "Good Vibes Only ✌️", ]; const handleClear = () => { change(""); inputRef.current?.focus(); }; const handleQuickText = (qt) => { change(qt); inputRef.current?.focus(); }; return ( {/* Stylischer Button über dem Textfeld */}
{/* Eingabe */}
change(e.target.value)} onFocus={() => setFocused(true)} onBlur={() => setFocused(false)} placeholder={placeholder} className="flex-1 border-0 bg-transparent text-gray-800 text-lg font-medium placeholder:text-gray-400 focus-visible:ring-0 focus-visible:ring-offset-0" maxLength={100} /> {!!safeLen(text) && ( )}
{/* Counter */} {safeLen(text)}/100
{/* Quick Examples */}
Quick Examples:
{quickTexts.map((qt) => ( ))}
{/* USP / SEO-Text */}

📱 Optimized for Instagram, TikTok, Threads & WhatsApp

🔍 SEO-safe Unicode – 100% copy-paste ready

🚀 Built for speed & mobile-first UX

); }