Rocky_Mountain_Vending/.pnpm-store/v10/files/a3/e34ae10c54b5d1f6adacbf43b50dc24a3c681ab93291af7eac16608188150382f396edb6ce14e58c0200607f99672551e6114779845b5634b1a0491539c631
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

30 lines
1 KiB
Text

import type { DayPickerProps } from "../types/index.js";
/**
* Extracts `data-` attributes from the DayPicker props.
*
* This function collects all `data-` attributes from the props and adds
* additional attributes based on the DayPicker configuration.
*
* @param props The DayPicker props.
* @returns An object containing the `data-` attributes.
*/
export function getDataAttributes(
props: DayPickerProps
): Record<string, unknown> {
const dataAttributes: Record<string, unknown> = {
"data-mode": props.mode ?? undefined,
"data-required": "required" in props ? props.required : undefined,
"data-multiple-months":
(props.numberOfMonths && props.numberOfMonths > 1) || undefined,
"data-week-numbers": props.showWeekNumber || undefined,
"data-broadcast-calendar": props.broadcastCalendar || undefined,
"data-nav-layout": props.navLayout || undefined
};
Object.entries(props).forEach(([key, val]) => {
if (key.startsWith("data-")) {
dataAttributes[key] = val;
}
});
return dataAttributes;
}