import type { JSX } from "solid-js";
import { splitProps } from "solid-js";

export interface DropdownMenuGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
  children?: JSX.Element;
}

/** Groups related DropdownMenu items together. */
export function DropdownMenuGroup(props: DropdownMenuGroupProps): JSX.Element {
  const [local, rest] = splitProps(props, ["children"]);
  return (
    <div role="group" {...rest}>
      {local.children}
    </div>
  );
}
