/** /DOBPicker.tsx **/ 'use client'; import * as React from 'react'; import { format, subYears } from 'date-fns'; import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/button'; import { Calendar } from '@/components/ui/calendar'; import { buttonVariants } from '@/components/ui/button'; import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; export function DOBPicker({ dob, setDOB }: { dob: Date | undefined; setDOB: React.Dispatch> }) { /** * The maximum date that can be selected is 18 years ago */ const maxDate = subYears(new Date(), 18); return (
); } export default DOBPicker; /** /ui/calendar.tsx **/ 'use client'; import * as React from 'react'; import { ChevronLeft, ChevronRight } from 'lucide-react'; import { DayPicker } from 'react-day-picker'; import { cn } from '@/lib/utils'; import { buttonVariants } from '@/components/ui/button'; export type CalendarProps = React.ComponentProps; function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) { return ( (