Refactor theme provider import and enhance calendar component for dynamic icon rendering

This commit is contained in:
Bram Suurd
2025-06-26 19:16:09 +02:00
parent 80938d0e6d
commit 4ee0c65053
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
"use client";
import type { ThemeProviderProps } from "next-themes/dist/types";
import type { ThemeProviderProps } from "next-themes";
import { ThemeProvider as NextThemesProvider } from "next-themes";

View File

@ -54,8 +54,12 @@ function Calendar({
...classNames,
}}
components={{
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
Chevron: ({ ...props }) => {
if (props.orientation === "left") {
return <ChevronLeft className="h-4 w-4" />;
}
return <ChevronRight className="h-4 w-4" />;
},
}}
{...props}
/>