import React from 'react';
import { Platform } from 'react-native';
import DatePickerAndroid from './DatePickerAndroid';
import DatePickerCalendar from './DatePickerCalendar';
import DatePickerIOS from './DatePickerIOS';
import type { DatePickerProps } from './types';

const DatePicker = ({ variant = 'default', ...props }: DatePickerProps) => {
  if (variant === 'calendar') {
    return <DatePickerCalendar {...props} />;
  }
  if (Platform.OS === 'ios') {
    return <DatePickerIOS {...props} variant={variant} />;
  }

  return <DatePickerAndroid {...props} variant={variant} />;
};

export default DatePicker;
