"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { useDatePickerContext } from "./use-date-picker-context.js";
import { useDatePickerViewPropsContext } from "./use-date-picker-view-props-context.js";
import { DatePickerTableCellPropsProvider } from "./use-date-picker-table-cell-props-context.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/date-picker/date-picker-table-cell.tsx
var splitTableCellProps = createSplitProps();
var DatePickerTableCell = forwardRef((props, ref) => {
	const [cellProps, localProps] = splitTableCellProps(props, [
		"disabled",
		"value",
		"visibleRange",
		"columns"
	]);
	const datePicker = useDatePickerContext();
	const viewProps = useDatePickerViewPropsContext();
	const mergedProps = mergeProps({
		day: datePicker.getDayTableCellProps,
		month: datePicker.getMonthTableCellProps,
		year: datePicker.getYearTableCellProps
	}[viewProps.view](cellProps), localProps);
	return /* @__PURE__ */ jsx(DatePickerTableCellPropsProvider, {
		value: cellProps,
		children: /* @__PURE__ */ jsx(ark.td, {
			ref,
			...mergedProps
		})
	});
});
DatePickerTableCell.displayName = "DatePickerTableCell";
//#endregion
export { DatePickerTableCell };
