File size: 646 Bytes
cf86710
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import * as components from "../components/custom-components.js";
import type { CustomComponents, DayPickerProps } from "../types/index.js";

/**
 * Merges custom components from the props with the default components.
 *
 * This function ensures that any custom components provided in the props
 * override the default components.
 *
 * @param customComponents The custom components provided in the DayPicker
 *   props.
 * @returns An object containing the merged components.
 */
export function getComponents(
  customComponents: DayPickerProps["components"],
): CustomComponents {
  return {
    ...components,
    ...customComponents,
  };
}