From fca0d3abdad62df8c40e1481ecc284606af54dbb Mon Sep 17 00:00:00 2001 From: mozsarmate Date: Mon, 3 Feb 2025 23:47:18 +0100 Subject: [PATCH] calendar fix II --- apps/frontend/src/components/ui/calendar.tsx | 96 +++++++++----------- 1 file changed, 45 insertions(+), 51 deletions(-) diff --git a/apps/frontend/src/components/ui/calendar.tsx b/apps/frontend/src/components/ui/calendar.tsx index 3cd65cc..492c420 100644 --- a/apps/frontend/src/components/ui/calendar.tsx +++ b/apps/frontend/src/components/ui/calendar.tsx @@ -1,70 +1,64 @@ -"use client" +'use client'; -import * as React from "react" -import { ChevronLeft, ChevronRight } from "lucide-react" -import { DayPicker } from "react-day-picker" +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" +import { cn } from '@/lib/utils'; +import { buttonVariants } from '@/components/ui/button'; -export type CalendarProps = React.ComponentProps +export type CalendarProps = React.ComponentProps; -function Calendar({ - className, - classNames, - showOutsideDays = true, - ...props -}: CalendarProps) { +// ✅ Move IconLeft and IconRight outside of Calendar +const IconLeft = ({ className, ...props }: React.ComponentProps<'svg'>) => ( + +); + +const IconRight = ({ className, ...props }: React.ComponentProps<'svg'>) => ( + +); + +function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) { return ( ( - - ), - IconRight: ({ className, ...props }) => ( - - ), + IconLeft, + IconRight, }} {...props} /> - ) + ); } -Calendar.displayName = "Calendar" +Calendar.displayName = 'Calendar'; -export { Calendar } +export { Calendar };