import Styles from "@/constants/Styles";
import { Feather, Ionicons } from "@expo/vector-icons";
import { Pressable, View } from "react-native";
import Text from "./Text";

type Props = {
   title: string
   user: string
   date: string
   onPress: () => void
}

export default function DiscussionItem({ title, user, date, onPress }: Props) {
   return (
      <Pressable style={[Styles.wrapItemDiscussion]} onPress={onPress}>
         <View style={[Styles.rowItemsCenter, Styles.mb10]}>
            <Ionicons name="chatbox-ellipses-outline" size={22} color="black" style={Styles.mr10} />
            <View style={[{flex:1}]}>
               <Text style={{ fontWeight: 'bold' }} numberOfLines={1} ellipsizeMode="tail">{title}</Text>
            </View>
         </View>
         <View style={Styles.rowSpaceBetween}>
            <View style={Styles.rowItemsCenter}>
               <Feather name="user" size={18} color="grey" style={Styles.mr05} />
               <Text style={[Styles.textInformation]}>{user}</Text>
            </View>
            <View style={Styles.rowItemsCenter}>
               <Feather name="clock" size={18} color="grey" style={Styles.mr05} />
               <Text style={[Styles.textInformation]}>{date}</Text>
            </View>
         </View>
      </Pressable>
   )
}