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

type Props = {
   content: 'carousel' | 'page';
   children: React.ReactNode;
   title: string
   headerColor: 'primary' | 'warning'
   onPress?: () => void
   contentPosition?: 'top' | 'center'
   titleTail?: number
};
export default function PaperGridContent({ content, children, title, headerColor, onPress, contentPosition, titleTail }: Props) {
   return (
      <Pressable onPress={onPress}>
         <View style={[content == 'carousel' ? Styles.wrapGridCaraousel : Styles.wrapGridContent, headerColor == 'warning' ? ColorsStatus.warning : ColorsStatus.primary]}>
            <View style={[Styles.headerPaperGrid]}>
               <Text numberOfLines={titleTail ? titleTail : undefined} style={[Styles.textSubtitle, headerColor == 'warning' ? Styles.cDefault : Styles.cWhite, {textAlign: 'center' }]}>{title}</Text>
            </View>
            <View style={[contentPosition && contentPosition == 'top' ? Styles.contentPaperGrid2 : Styles.contentPaperGrid]}>
               {children}
            </View>
         </View>
      </Pressable>

   )
}