"use client" import { useState } from "react" import { View, TextInput, TouchableOpacity, Text, Alert } from "react-native" import { Feather } from "@expo/vector-icons" interface CommentInputProps { isAuthenticated: boolean onSubmit: (text: string) => Promise isSubmitting: boolean } export default function CommentInput({ isAuthenticated, onSubmit, isSubmitting }: CommentInputProps) { const [commentText, setCommentText] = useState("") const handleSubmit = async () => { if (!isAuthenticated || !commentText.trim()) { if (!isAuthenticated) { Alert.alert("Authentication Required", "Please log in to comment.") } return } try { await onSubmit(commentText.trim()) setCommentText("") } catch (error) { console.error("Error submitting comment:", error) } } return ( {!isAuthenticated && Please log in to comment} ) }