import React from 'react';
import DateTimePicker, { useDefaultStyles } from 'react-native-ui-datepicker';
import { ChevronLeft, ChevronRight } from 'lucide-react-native';

type AppDatePickerProps = React.ComponentProps<typeof DateTimePicker>;

export const AppDatePicker = (props: AppDatePickerProps) => {
    const defaultStyles = useDefaultStyles('light');

    return (
        <DateTimePicker
            {...props}    
            locale="it" 
            components={{
                IconPrev: <ChevronLeft size={24} color="#1f2937" pointerEvents="none" />,
                IconNext: <ChevronRight size={24} color="#1f2937" pointerEvents="none" />,
                ...props.components,
            }}
            styles={{
                ...defaultStyles,
                selected: { backgroundColor: '#099499' },
                ...props.styles, 
            }}
        />
    );
};