import type { JSX } from "solid-js";
import { splitProps } from "solid-js";
import type { CalendarGridProps } from "./calendar.props";

/** Table element with role="grid" wrapping the calendar head and body. */
export function CalendarGrid(props: CalendarGridProps): JSX.Element {
  const [local, rest] = splitProps(props, ["children"]);
  return (
    <table data-scope="calendar" data-part="grid" role="grid" {...rest}>
      {local.children}
    </table>
  );
}
