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

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

/** Label for a DropdownMenu group. */
export function DropdownMenuGroupLabel(props: DropdownMenuGroupLabelProps): JSX.Element {
  const [local, rest] = splitProps(props, ["children"]);
  const id = createUniqueId();
  return (
    <div id={id} role="presentation" {...rest}>
      {local.children}
    </div>
  );
}
