import Styles from "@/constants/Styles";
import { Pressable, View } from "react-native";
import Text from "./Text";

type Props = {
   category: 'purple' | 'orange'
   title: string
   user: string
   jamAwal: string
   jamAkhir: string
   onPress?: () => void
}

export default function EventItem({ category, title, user, jamAwal, jamAkhir, onPress }: Props) {
   return (
      <Pressable style={[Styles.itemEvent, { backgroundColor: category == 'orange' ? '#FED6C5' : '#D8D8F1' }]} onPress={onPress}>
         <View style={[Styles.dividerEvent, { backgroundColor: category == 'orange' ? '#FB804C' : '#535FCA' }]} />
         <View>
            <Text>{jamAwal} - {jamAkhir}</Text>
            <Text numberOfLines={1} ellipsizeMode="tail" style={[Styles.textDefaultSemiBold, Styles.mv05]}>{title}</Text>
            <Text numberOfLines={1} ellipsizeMode="tail">Dibuat oleh : {user}</Text>
         </View>
      </Pressable>
   )
}